Skip to content

Commit

Permalink
Fixes for missing cam/music
Browse files Browse the repository at this point in the history
Fix up some cases where reconfiguring TeslaUSB to no longer have
cam or music disks wasn't handled correctly.
  • Loading branch information
marcone committed Dec 17, 2024
1 parent 5eb1e8e commit 572eb7d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 6 additions & 3 deletions run/cifs_archive/disconnect-archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
# block a return to archiveloop.

{
log "unmounting $ARCHIVE_MOUNT"
if ! umount -f -l "$ARCHIVE_MOUNT"
if [ -e "$ARCHIVE_MOUNT" ]
then
log "unmount failed"
log "unmounting $ARCHIVE_MOUNT"
if ! umount -f -l "$ARCHIVE_MOUNT"
then
log "unmount failed"
fi
fi

if [ -e "$MUSIC_ARCHIVE_MOUNT" ]
Expand Down
6 changes: 6 additions & 0 deletions run/cifs_archive/verify-and-configure-archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ function configure_archive () {
then
local sharenameforstab="${SHARE_NAME// /\\040}"
echo "//$ARCHIVE_SERVER/$sharenameforstab $archive_path cifs noauto,credentials=${credentials_file_path},iocharset=utf8,file_mode=0777,dir_mode=0777,$VERS_OPT,$SEC_OPT 0" >> /etc/fstab
elif [ -d "$archive_path" ]
then
rmdir "$archive_path" || log_progress "failed to remove $archive_path"
fi

if [ -n "${MUSIC_SHARE_NAME:+x}" ]
Expand All @@ -160,6 +163,9 @@ function configure_archive () {
fi
local musicsharenameforstab="${MUSIC_SHARE_NAME// /\\040}"
echo "//$ARCHIVE_SERVER/$musicsharenameforstab $music_archive_path cifs noauto,credentials=${credentials_file_path},iocharset=utf8,file_mode=0777,dir_mode=0777,$VERS_OPT,$SEC_OPT 0" >> /etc/fstab
elif [ -d "$music_archive_path" ]
then
rmdir "$music_archive_path" || log_progress "failed to remove $music_archive_path"
fi
log_progress "Configured the archive."
}
Expand Down

0 comments on commit 572eb7d

Please sign in to comment.