forked from NARKOZ/hacker-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
smack-my-bitch-up.sh
executable file
·38 lines (30 loc) · 804 Bytes
/
smack-my-bitch-up.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh -e
DAYOFWEEK=$(date +%u)
# Skip on weekends
if [ "$DAYOFWEEK" -eq 6 ] || [ "$DAYOFWEEK" -eq 7 ]; then
exit
fi
# Exit early if no sessions with my_username are found
if ! who | grep -wq 'my_username'; then
exit
fi
# Phone numbers
MY_NUMBER='+xxx'
HER_NUMBER='+xxx'
REASONS=(
'Working hard'
'Gotta ship this feature'
'Someone fucked the system again'
)
rand=$[ $RANDOM % ${#REASONS[@]} ]
RANDOM_REASON=${REASONS[$rand]}
MESSAGE="Late at work. "$RANDOM_REASON
# Send a text message
RESPONSE=`curl -fSs -u "$TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN" \
-d "From=$MY_NUMBER" -d "To=$HER_NUMBER" -d "Body=$MESSAGE" \
"https://api.twilio.com/2010-04-01/Accounts/$TWILIO_ACCOUNT_SID/SMS/Messages"`
# Log errors
if [ $? -gt 0 ]; then
echo "Failed to send SMS: $RESPONSE"
exit 1
fi