Created
February 22, 2011 22:58
-
-
Save metal3d/839619 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
#Script de Démarrage des Ordinateurs sur l'interface réseau eth1 | |
# | |
MACADDR=00:50:BA:CB:CD:B8 | |
/usr/bin/wol -i 192.168.1.255 $MACADDR | |
#Maintenant on tourne en boucle et on attend que le pc annonce qu'il existe | |
notalive=1 | |
while [ $notalive == "1" ] | |
do | |
avahi-browse-domains -at | grep $MACADDR | |
#$? vaut 1 si grep a foiré, 0 si il a marché, donc si la machine est trouvé, $? vaut 0 | |
#on assigne ça à notalive, et on va quitter la boucle | |
notalive=$? | |
done | |
#on annonce que le pc est trouvé | |
notify-send "PC allumé" "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment