From 5b75897c7d480df27ef266272c99e63efd499695 Mon Sep 17 00:00:00 2001 From: cimryan Date: Tue, 23 Oct 2018 18:18:35 -0700 Subject: [PATCH] Move creation of the TeslaCam directory to create-backingfiles.sh The create-backingfiles.sh file already contains the responsibility for defining the mount points, which this step needs. --- windows_archive/create-backingfiles.sh | 8 ++++++++ windows_archive/setup-teslausb | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/windows_archive/create-backingfiles.sh b/windows_archive/create-backingfiles.sh index a406df4..69f19b4 100644 --- a/windows_archive/create-backingfiles.sh +++ b/windows_archive/create-backingfiles.sh @@ -21,6 +21,12 @@ function add_drive () { echo "$filename $mountpoint vfat noauto,users,umask=000 0 0" >> /etc/fstab } +function create_teslacam_directory () { + mount /mnt/cam + mkdir /mnt/cam/TeslaCam + umount /mnt/cam +} + FREE_1K_BLOCKS="$(df --output=avail --block-size=1K /backingfiles/ | tail -n 1)" CAM_DISK_SIZE="$(( $FREE_1K_BLOCKS * $CAM_PERCENT / 100 ))" @@ -36,3 +42,5 @@ then else echo "options g_mass_storage file=$CAM_DISK_FILE_NAME removable=1 ro=0 stall=0 iSerialNumber=123456" > "$G_MASS_STORAGE_CONF_FILE_NAME" fi + +create_teslacam_directory diff --git a/windows_archive/setup-teslausb b/windows_archive/setup-teslausb index 3fe1526..c50b31b 100644 --- a/windows_archive/setup-teslausb +++ b/windows_archive/setup-teslausb @@ -139,12 +139,6 @@ function create_usb_drive_backing_files () { /tmp/create-backingfiles.sh "$campercent" "$BACKINGFILES_MOUNTPOINT" } -function create_teslacam_directory () { - mount /mnt/cam - mkdir /mnt/cam/TeslaCam - umount /mnt/cam -} - function configure_archive () { local archive_server_ip_address="$1" @@ -276,8 +270,6 @@ echo "" >> /etc/fstab create_usb_drive_backing_files -create_teslacam_directory - configure_archive "$ARCHIVE_SERVER_IP_ADDRESS" configure_rc_local