Created
July 20, 2013 05:32
-
-
Save Akkiesoft/6043978 to your computer and use it in GitHub Desktop.
SSIDを監視して、みつけたら音声を鳴らすスクリプト。自宅に帰宅してからモバイルルーターの電源切り忘れる人とか向け。ミクさんボイスを http://8639.tk/router.wav に置いたので欲しい人はどうぞ。他にも、音声じゃなくてトゥイッターでメンションとかなげるんでもいいんじゃないですかね。
This file contains hidden or 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 | |
SSID="YOUR_SSID_NAME" | |
LIST=` | |
# Get SSID List | |
/sbin/iwlist wlan0 scan | \ | |
# Extract line of including "ESSID" | |
grep ESSID | \ | |
# Extract SSID name | |
awk -F '"' '{print $2}' |\ | |
# And skip empty line | |
awk 'NF>0 {print $1}' | |
` | |
for i in ${LIST} | |
do | |
if [ ${i} = ${SSID} ] ; then | |
/usr/bin/aplay -q router.wav | |
break | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment