17 lines
508 B
Bash
17 lines
508 B
Bash
|
#!/usr/bin/env bash
|
||
|
|
||
|
source "$run_directory/variables.conf"
|
||
|
|
||
|
# Set parameters here
|
||
|
host=$(hostname -f)
|
||
|
sysboot=$(who -b | sed 's/^[ \t]*//;s/[ \t]*$//')
|
||
|
time=$(date "+%Y-%m-%d %H:%M:%S")
|
||
|
msg="$host has rebooted. $sysboot If you did not initiate this, a power failure has probably occured. Message sent on $time."
|
||
|
msg=$(echo $msg | sed -e "s/ /%20/g") # Replace spaces with %20 as we are in an URL
|
||
|
|
||
|
# Actual process
|
||
|
URL="https://smsapi.free-mobile.fr/sendmsg?user=$user&pass=$pass&msg=$msg"
|
||
|
curl $URL
|
||
|
|
||
|
exit 0
|