- Added a config file for parameters - Changed logging - Log name is based on ID_FS_LABEL (dvd name) variable set by udev in order to isolate logging from multiple process running simultaneously - Log file name and path set in config file - Log file cleanup based on parameter set in config file - Added phone notification options for Pushbullet and IFTTT - Remove MakeMKV destination directory after HandBrake finishes transcoding - Misc stuff
27 lines
690 B
Bash
Executable File
27 lines
690 B
Bash
Executable File
#!/bin/bash
|
|
|
|
source /opt/arm/config
|
|
MSG=$1
|
|
|
|
{
|
|
#Notification via pushbullet
|
|
#Trigger onl if variable is set
|
|
if [ -z "$PB_KEY" ]; then
|
|
echo "Pushbullet notifications not enabled" >> $LOG
|
|
else
|
|
curl -s -u $PB_KEY: https://api.pushbullet.com/v2/pushes -d type=note -d title="Alert" -d body="$MSG"
|
|
echo "Pushbullet notification sent" >> $LOG
|
|
fi
|
|
|
|
#Notification via IFTTT
|
|
#Trigger only if variable is set
|
|
if [ -z "$IFTTT_KEY" ]; then
|
|
echo "IFTTT notifications not enabled" >> $LOG
|
|
else
|
|
curl -s -X POST -H "Content-Type: application/json" -d '{"value1":"'"$MSG"'"}' https://maker.ifttt.com/trigger/${IFTTT_EVENT}/with/key/${IFTTT_KEY}
|
|
printf "\nIFTTT notification sent" >> $LOG
|
|
fi
|
|
|
|
} >> $LOG
|
|
|