Skip to content

Commit

Permalink
ext: Restart smb as necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
cdown committed Dec 31, 2023
1 parent 384cc4e commit e0d3a98
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bin/ext
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@ fi
part=${parts[0]}
label=${part##*/}

smb=0
dest=/mnt/scratch
if [[ -d /srv/samba ]]; then
dest=/srv/samba
smb=1
fi

if (( smb )); then
sudo systemctl stop smb
fi

case ${1?} in
Expand All @@ -46,6 +52,10 @@ case ${1?} in
else
sudo bindfs -u "$(id -u)" --create-for-user="$(stat -c %u /mnt/scratch-baduser)" /mnt/scratch-baduser "$dest"
fi

if (( smb )); then
sudo systemctl start smb
fi
;;
unmount)
sudo umount "$dest"
Expand Down

0 comments on commit e0d3a98

Please sign in to comment.