summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSimon Rettberg2015-01-23 19:19:58 +0100
committerSimon Rettberg2015-01-23 19:19:58 +0100
commit2eb5cea8578c2884c6f30fa379212bbfc1554bed (patch)
tree12d4eb781782e07e41b084444a2185a978e90c98 /scripts
parentPimp my boot menu (diff)
downloadtmlite-bwlp-2eb5cea8578c2884c6f30fa379212bbfc1554bed.tar.gz
tmlite-bwlp-2eb5cea8578c2884c6f30fa379212bbfc1554bed.tar.xz
tmlite-bwlp-2eb5cea8578c2884c6f30fa379212bbfc1554bed.zip
Stuff
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/mount-store14
-rwxr-xr-xscripts/system-backup1
-rwxr-xr-xscripts/system-restore5
3 files changed, 16 insertions, 4 deletions
diff --git a/scripts/mount-store b/scripts/mount-store
index cd31952..f138c5f 100755
--- a/scripts/mount-store
+++ b/scripts/mount-store
@@ -60,14 +60,20 @@ touch "${DEST}/.notmounted"
if grep -E -q '^[^/].+:.+' <<<$SOURCE; then
# seems to be NFS
- mount -t nfs -o rw,async,nolock,vers=3,fg,ac,retry=1,timeo=600 "$SOURCE" "$DEST"
- RET=$?
+ for i in 1 2 3; do
+ mount -t nfs -o rw,async,nolock,vers=3,fg,ac,retry=1,timeo=100,sec=sys "$SOURCE" "$DEST"
+ RET=$?
+ [ "$RET" -eq "0" ] && break
+ done
elif grep -E -q '^//' <<<$SOURCE; then
# seens to be SMB
export USER="$USERNAME"
export PASSWD="$PASSWORD"
- mount -t cifs -o rw,uid=0,gid=12345,forceuid,forcegid,file_mode=0664,dir_mode=0775,sec=ntlm "$SOURCE" "$DEST"
- RET=$?
+ for sec in ntlmv2 ntlm; do
+ 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
+ done
unset USER PASSWD
else
echo "Unknown mount type: $SOURCE"
diff --git a/scripts/system-backup b/scripts/system-backup
index 21f791b..d4b9ebe 100755
--- a/scripts/system-backup
+++ b/scripts/system-backup
@@ -27,6 +27,7 @@ FILELIST="
/opt/syncdaemon/config/identity.properties
/etc/lighttpd/server.pem
/etc/lighttpd/chain.pem
+ /srv/openslx/www/boot/default/config.tgz
"
tar --ignore-failed-read -k -c -p -z -f files.tgz $FILELIST # no quotes here!
diff --git a/scripts/system-restore b/scripts/system-restore
index a95a185..5d77dda 100755
--- a/scripts/system-restore
+++ b/scripts/system-restore
@@ -45,7 +45,12 @@ if [ $RET -ne 0 ]; then
echo "Error: Restoring database contents failed with exit code $RET"
exit 1
fi
+# Since we came that far we'll delete some old configs (if existent)
+rm -rf /opt/ldadp/{configs,pid,logs}/* /opt/openslx/configs/* /srv/openslx/www/boot/default/config.tgz 2> /dev/null
+# Force triggering IP detection/setting, which should in turn regenerate ldadp configs and launch ldadp instances if applicable
echo "UPDATE openslx.property SET value = 'invalid' WHERE name = 'server-ip' LIMIT 1" | mysql --defaults-extra-file=/etc/mysql/debian.cnf --default-character-set=utf8
+# Try to update the db (if required)
+curl -s 'http://localhost/slx-admin/api.php?do=update'
tar --ignore-failed-read -x -f files.tgz -C /
RET=$?