diff --git a/.gitignore b/.gitignore index 5e49c24..d482ba9 100755 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ logs/* test.sh archive/ +config diff --git a/config.sample b/config.sample new file mode 100644 index 0000000..413b7fa --- /dev/null +++ b/config.sample @@ -0,0 +1,71 @@ +#!/bin/bash +# ARM (Automatic Ripping Machine) oonfig file + +##################### +## Directory setup ## +##################### + +#Base directory of ARM media directory +#Ripped and transcoded files end up here +ARMPATH="/mnt/media/ARM/" + +#Path to raw MakeMKV directory +#Destination for MakeMKV and source for HandBrake +RAWPATH="/mnt/media/ARM/raw/" + +#Path to directory to hold log files +#Make sure to include trailing / +LOGPATH="/opt/arm/logs/" + +#How long to let log files live before deleting (in days) +LOGLIFE=1 + +######################## +## MakeMKV Parameters ## +######################## + +#Minimum length of track for MakeMKV rip (in seconds) +MINLENGTH="600" + + +########################## +## HandBrake Parameters ## +########################## + +# Handbrake preset profile +# See https://trac.handbrake.fr/wiki/BuiltInPresets +HB_PRESET="High Profile" + +#Extension of the final video file +DEST_EXT=mkv + +#Handbrake binary to call +HANDBRAKE_CLI=HandBrakeCLI + +############################# +## Notification Parameters ## +############################# + +#Pushbullet API Key +#Leave empty or comment out to disable Pushbullet notifications +#PB_KEY="" + +#IFTTT API KEY +#Leave empty or comment out to disable IFTTT notifications +#IFTTT_KEY="" + +#IFTTT Event Name +IFTTT_EVENT="arm_event" + +#Determine logfile name +#use the label of the DVD/CD or else use empty.log +#this is required for udev events where there is no media available +#such as ejecting the drive +if [ -z $ID_FS_LABEL]; then + LOGFILE="empty.log" +else + LOGFILE=${ID_FS_LABEL}".log" +fi + +#Set full logfile path +LOG=$LOGPATH$LOGFILE diff --git a/identify.sh b/identify.sh index 48610aa..720945d 100755 --- a/identify.sh +++ b/identify.sh @@ -2,9 +2,13 @@ # source /opt/arm/config +# Create log dir if needed +mkdir -p $LOGPATH + { echo "Starting Identify Script..." >> $LOG + #Clean up old log files FILESFOUND=( $(find $LOGPATH -mtime +$LOGLIFE -type f)) echo "Deleting ${#FILESFOUND[@]} old log files:"${FILESFOUND[@]} >> $LOG