From 03d4df41275e376a7f3e72b66725ce43c8111660 Mon Sep 17 00:00:00 2001 From: Ray Tanaka Date: Tue, 23 Oct 2018 23:20:21 -0700 Subject: [PATCH 1/4] use BACKINGFILES_MOUNTPOINT in all places for consistency --- setup/pi/create-backingfiles.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/pi/create-backingfiles.sh b/setup/pi/create-backingfiles.sh index 69f19b4..80740fd 100644 --- a/setup/pi/create-backingfiles.sh +++ b/setup/pi/create-backingfiles.sh @@ -27,7 +27,7 @@ function create_teslacam_directory () { umount /mnt/cam } -FREE_1K_BLOCKS="$(df --output=avail --block-size=1K /backingfiles/ | tail -n 1)" +FREE_1K_BLOCKS="$(df --output=avail --block-size=1K $BACKINGFILES_MOUNTPOINT/ | tail -n 1)" CAM_DISK_SIZE="$(( $FREE_1K_BLOCKS * $CAM_PERCENT / 100 ))" CAM_DISK_FILE_NAME="$BACKINGFILES_MOUNTPOINT/cam_disk.bin" From 01bccb821a2e4939ccb22f3abc6ed4f67771fcd4 Mon Sep 17 00:00:00 2001 From: Ray Tanaka Date: Wed, 24 Oct 2018 23:54:00 -0700 Subject: [PATCH 2/4] removing another reference to hardcoded directory --- setup/pi/create-backingfiles.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/pi/create-backingfiles.sh b/setup/pi/create-backingfiles.sh index 80740fd..f7aa695 100644 --- a/setup/pi/create-backingfiles.sh +++ b/setup/pi/create-backingfiles.sh @@ -35,7 +35,7 @@ add_drive "cam" "CAM" "$CAM_DISK_SIZE" "$CAM_DISK_FILE_NAME" if [ "$CAM_PERCENT" -lt 100 ] then - MUSIC_DISK_SIZE="$(df --output=avail --block-size=1K /backingfiles/ | tail -n 1)" + MUSIC_DISK_SIZE="$(df --output=avail --block-size=1K $BACKINGFILES_MOUNTPOINT/ | tail -n 1)" MUSIC_DISK_FILE_NAME="$BACKINGFILES_MOUNTPOINT/music_disk.bin" add_drive "music" "MUSIC" "$MUSIC_DISK_SIZE" "$MUSIC_DISK_FILE_NAME" echo "options g_mass_storage file=$CAM_DISK_FILE_NAME,$MUSIC_DISK_FILE_NAME removable=1,1 ro=0,0 stall=0 iSerialNumber=123456" > "$G_MASS_STORAGE_CONF_FILE_NAME" From ada91ef7e7561a5ae396f7a7f2be3160c082f1b0 Mon Sep 17 00:00:00 2001 From: Ray Tanaka Date: Wed, 24 Oct 2018 23:56:57 -0700 Subject: [PATCH 3/4] removing a couple more references here too --- setup/pi/setup-teslausb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup/pi/setup-teslausb b/setup/pi/setup-teslausb index abf884a..1b208ce 100644 --- a/setup/pi/setup-teslausb +++ b/setup/pi/setup-teslausb @@ -95,14 +95,14 @@ function create_usb_drive_backing_files () { /tmp/create-backingfiles-partition.sh "$BACKINGFILES_MOUNTPOINT" fi - if ! findmnt --mountpoint /backingfiles + if ! findmnt --mountpoint $BACKINGFILES_MOUNTPOINT then echo "Mounting the partition for the backing files..." - mount /backingfiles + mount $BACKINGFILES_MOUNTPOINT echo "Mounted the partition for the backing files." fi - if [ ! -e /backingfiles/*.bin ] + if [ ! -e $BACKINGFILES_MOUNTPOINT/*.bin ] then /tmp/create-backingfiles.sh "$campercent" "$BACKINGFILES_MOUNTPOINT" fi From 3263313cdbcd51d4e423bc5194cbe098c0ff4af0 Mon Sep 17 00:00:00 2001 From: Ray Tanaka Date: Thu, 25 Oct 2018 01:40:49 -0700 Subject: [PATCH 4/4] bug fix: missing space to address script error --- run/send-pushover | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run/send-pushover b/run/send-pushover index 3a6192a..9d5ffa5 100644 --- a/run/send-pushover +++ b/run/send-pushover @@ -7,7 +7,7 @@ function log () { echo "$1" >> "$LOG_FILE" } -if [ -r "/root/.teslaCamPushoverCredentials" ] && [ $NUM_FILES_MOVED > 0] +if [ -r "/root/.teslaCamPushoverCredentials" ] && [ $NUM_FILES_MOVED > 0 ] then log "Sending Pushover message for moved files."