mirror of
https://github.com/cimryan/teslausb.git
synced 2026-03-01 04:30:33 +00:00
Prepare for abstract connect, disconnect, archive.
This commit is contained in:
@@ -14,19 +14,15 @@ function disconnect_usb_drives_from_host () {
|
||||
log "Disconnected usb from host."
|
||||
}
|
||||
|
||||
function ensure_archive_is_mounted () {
|
||||
log "Ensuring cam archive is mounted..."
|
||||
ensure_mountpoint_is_mounted_with_retry "$ARCHIVE_MOUNT"
|
||||
log "Ensured cam archive is mounted."
|
||||
}
|
||||
|
||||
export -f log
|
||||
|
||||
log "Starting..."
|
||||
|
||||
if [ ! -r "/root/.teslaCamRsyncConfig" ]
|
||||
if [ -r "/root/.teslaCamRsyncConfig" ]
|
||||
then
|
||||
ensure_archive_is_mounted
|
||||
/root/bin/connect-archive-rsync.sh
|
||||
else
|
||||
/root/bin/connect-archive-cifs.sh
|
||||
fi
|
||||
|
||||
disconnect_usb_drives_from_host
|
||||
@@ -42,6 +38,13 @@ else
|
||||
/root/bin/archive-cifs.sh
|
||||
fi
|
||||
|
||||
if [ -r "/root/.teslaCamRsyncConfig" ]
|
||||
then
|
||||
/root/bin/disconnect-archive-rsync.sh
|
||||
else
|
||||
/root/bin/disconnect-archive-cifs.sh
|
||||
fi
|
||||
|
||||
unmount_cam_file
|
||||
|
||||
connect_usb_drives_to_host
|
||||
|
||||
Reference in New Issue
Block a user