summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/mount-store20
1 files changed, 14 insertions, 6 deletions
diff --git a/scripts/mount-store b/scripts/mount-store
index f138c5f..d5dcbba 100755
--- a/scripts/mount-store
+++ b/scripts/mount-store
@@ -66,13 +66,17 @@ if grep -E -q '^[^/].+:.+' <<<$SOURCE; then
[ "$RET" -eq "0" ] && break
done
elif grep -E -q '^//' <<<$SOURCE; then
- # seens to be SMB
+ # seems to be SMB
export USER="$USERNAME"
export PASSWD="$PASSWORD"
for sec in ntlmv2 ntlm; do
+ echo " * Trying ${sec}..."
mount -t cifs -o rw,uid=0,gid=12345,forceuid,forcegid,file_mode=0664,dir_mode=0775,sec=$sec "$SOURCE" "$DEST"
RET=$?
- [ "$RET" -eq "0" ] && break
+ if [ "$RET" -eq "0" ]; then
+ echo " * Success!"
+ break
+ fi
done
unset USER PASSWD
else
@@ -82,20 +86,24 @@ fi
if [ "$RET" == "0" ]; then
chgrp -R images "$DEST" 2>/dev/null
- chmod -R ug+rw "$DEST" 2>/dev/null
- for DIR in $(find "$DEST" -type d); do
- chmod ug+x "$DIR" 2>/dev/null
- done
+ chmod -R ug+rwX "$DEST" 2>/dev/null
TEST="$DEST/.test-$RAND-$RAND"
sudo -n -u dmsd touch "$TEST"
RET=$?
if [ -e "$TEST" ]; then
sudo -n -u dmsd rm -f -- "$TEST"
else
+ [ "$RET" = "0" ] && RET=127
echo "Error: Mounted share is not writable, aborting." >&2
umount -v "$DEST"
fi
fi
+if [ "$RET" = "0" ]; then
+ echo "----------------------------------"
+ echo "-- Share mounted successfully! --"
+ echo "----------------------------------"
+fi
+
exit $RET