#!/bin/bash #サーバーのip sshserver_ip="192.168.0.101" #サーバーのMacアドレス macaddress="00:19:66:0A:A1:6E" #ノーティファイアイコン notify_icon="/usr/share/icons/Humanity/apps/48/gksu-root-terminal.svg" ########################################## ########## 設定するのはここまで ########## ########################################## sudo etherwake $macaddress count=1 while [ 0 ]; do ping_res=$(ping -c1 $sshserver_ip) if echo $ping_res | grep -sq ", 0% packet loss" then putty exit else if [ $count -ge 30 ] then notify-send -i $notify_icon "I can't find the server." && aplay '/usr/share/sounds/Media/Uh oh.wav' >/dev/null 2>&1 exit fi let ++count fi done