Skip to content

Instantly share code, notes, and snippets.

@nefo-mi
Last active December 17, 2015 21:19
Show Gist options
  • Save nefo-mi/5674273 to your computer and use it in GitHub Desktop.
Save nefo-mi/5674273 to your computer and use it in GitHub Desktop.
全自動めざましじゃんけん
#! /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