Last active
December 17, 2015 21:19
-
-
Save nefo-mi/5674273 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/bash | |
curl -d 'signal=pon' 'localhost:4567' | |
sleep 3 | |
curl -d 'signal=8ch' 'localhost:4567' | |
sleep 1 | |
rand=`expr $RANDOM % 3` | |
if [ $rand -eq 0 ]; then | |
curl -d 'signal=blue' 'localhost:4567' | |
elif [ $rand -eq 1 ]; then | |
curl -d 'signal=red' 'localhost:4567' | |
else | |
curl -d 'signal=green' 'localhost:4567' | |
fi | |
sleep 1 | |
curl -d 'signal=pon' 'localhost:4567' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment