Skip to content

Instantly share code, notes, and snippets.

@timilsinabishal
Last active January 22, 2017 14:46
Show Gist options
  • Save timilsinabishal/97d3c29d38098fa49887a387406e5703 to your computer and use it in GitHub Desktop.
Save timilsinabishal/97d3c29d38098fa49887a387406e5703 to your computer and use it in GitHub Desktop.
Script to automate some task when the computer boots
#!/bin/bash
set result =""
function checkAp {
nmcli -f BSSID,ACTIVE,SSID dev wifi list | awk '$3 ~ /YIPL-*/ && $2 ~ /yes/ {print $2}'
return
}
function runScripts(){
for i in $(find $1 -type f)
do
sh ./$i
done
}
result=$(checkAp)
if [[ $result == "yes" ]]; then
#now start required apps for office
hipchat4 &
runScripts ../yipl/startup
#start scripts from office startup folders
fi
#List of all required apps
google-chrome &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment