The Driving Force View on Github
‘I am so sorry. I slept at 2 am and couldn’t wake up on time.’
Today, most of us can relate ourselves to this, especially college going students and teenagers. I have this problem of sleeping very late (see I am awake and writing this post in the middle of the night and I am 200% sure that I’ll be late for my work tomorrow) I forget things, reach late for work/college and sometimes my friends have to wait till they get totally pissed off. And then I need to switch to a loop of apology to make the situation better.
The problem is alarms cannot wake me up, but getting a phone call on my mobile does. I don’t know why, but it works for me.
A reminder utility bash script to make automatic repetitive calls to a mobile number at an interval.
- Linux: because penguin.
- Skype Credit: as we need to make phone calls to your mobile (I had some credit from one of my previous hack).
- Recieve command line parameters in shell script.123456789101112131415161718192021222324252627282930313233echo Skype Reminder.mobile=hrs=min=sec=delay=N=while getopts p:h:m:s:d:n: opt; docase $opt inp)mobile=$OPTARG;;h)hrs=$OPTARG;;m)min=$OPTARG;;s)sec=$OPTARG;;d)delay=$OPTARG;;n)N=$OPTARG;;esacdoneshift $((OPTIND - 1))
- Calculate the time and number of times the call should be made.123456789101112131415161718192021222324let 'hrs = hrs + 0'let 'min = min + 0'let 'sec = sec + 0'let 'delay = delay + 0'let 'N = N + 0'let 'tot = min + (hrs * 60)'let 'tot = sec + (tot * 60)'printf '\n'echo "Mobile: "$mobileecho "Hrs: "$hrsecho "Min: "$minecho "Sec: "$sececho "Total Sec: "$totif [ $N -eq '0' ]thenlet 'N = 1'fiprintf '\n'echo "Delay: "$delayecho "Number of times: "$N
- Create a loop to make phone calls consecutively using skype command.1234567891011121314151617printf '\n'sleep "$tot"for (( c=1; c<=N; c++ ))doecho "Call "$cskype --callto "$mobile"if [ $N -eq $c ]thenbreak;fisleep "$delay"doneprintf '\n'echo "Thank You for using our service."printf '\n'echo"***************************************************************"
- Save it as AngryAlbatross.sh in a directory, say ‘Documents’.
- Open terminal in the directory where this file is located and change permissions of the file.12cd director_namechmod +x AngryAlbatross.sh
- Run the script with command line parameters. Eg. To make a call 5 times with delay of 30 seconds between consecutive calls, on a mobile number (+91XXXXXXXXXX), after 4 hrs 3 minutes and 10 seconds, use the following command.12./AngryAlbatross.sh -p +phone -h hours -m minutes -s seconds -d delay_between_calls -n number_of_times./AngryAlbatross.sh -p +91XXXXXXXXXX -h 4 -m 3 -s 10 -d 30 -n 5
Now wait for the call.