summaryrefslogtreecommitdiffstats
path: root/scripts/mount-store
diff options
context:
space:
mode:
authorSimon Rettberg2015-01-28 17:59:14 +0100
committerSimon Rettberg2015-01-28 17:59:14 +0100
commitdb84c47f6b40a6ae380427b23a07ec73d658928a (patch)
tree80988f70d9e87d6a2f7d204aa627fbb0e7a973b9 /scripts/mount-store
parent[RecompressArchive] Use temporary file for compression, only move to destinat... (diff)
downloadtmlite-bwlp-db84c47f6b40a6ae380427b23a07ec73d658928a.tar.gz
tmlite-bwlp-db84c47f6b40a6ae380427b23a07ec73d658928a.tar.xz
tmlite-bwlp-db84c47f6b40a6ae380427b23a07ec73d658928a.zip
[mount-store] Add success message
Diffstat (limited to 'scripts/mount-store')
-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