diff options
author | nachoparker <nacho@ownyourbits.com> | 2018-03-16 16:58:49 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2018-03-16 16:59:03 +0300 |
commit | 38dfa60508a6fabb2711d3d8cdd3c997632f5cf9 (patch) | |
tree | 96261fa22a6d667193fbaa0f67bb19d89623db75 | |
parent | b3be94805031b7ca23e54de78ba4543d9ecfd97e (diff) |
fix for nc-automount-linksv0.47.3
-rw-r--r-- | changelog.md | 4 | ||||
-rw-r--r-- | etc/nextcloudpi-config.d/nc-automount.sh | 4 | ||||
-rwxr-xr-x | update.sh | 26 |
3 files changed, 31 insertions, 3 deletions
diff --git a/changelog.md b/changelog.md index c1c082af..43ce79ee 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ -[v0.47.2](https://github.com/nextcloud/nextcloudpi/commit/3766959) (2018-03-15) improve dependency of database with automount +[v0.47.3](https://github.com/nextcloud/nextcloudpi/commit/4156bb7) (2018-03-16) fix for nc-automount-links + +[v0.47.2](https://github.com/nextcloud/nextcloudpi/commit/66cb00a) (2018-03-15) improve dependency of database with automount [v0.47.1 ](https://github.com/nextcloud/nextcloudpi/commit/9f6c479) (2018-03-10) update: make sure redis log exists diff --git a/etc/nextcloudpi-config.d/nc-automount.sh b/etc/nextcloudpi-config.d/nc-automount.sh index 8577b7d8..3ffaf1ae 100644 --- a/etc/nextcloudpi-config.d/nc-automount.sh +++ b/etc/nextcloudpi-config.d/nc-automount.sh @@ -75,9 +75,9 @@ ls -d /media/* &>/dev/null && { i=0 for d in $( ls -d /media/* 2>/dev/null ); do if [ $i -eq 0 ]; then - [[ -e /media/USBdrive ]] || mountpoint -q "$d" && ln -sT "$d" /media/USBdrive + test -e /media/USBdrive || test -d "$d" && ln -sT "$d" /media/USBdrive else - [[ -e /media/USBdrive$i ]] || mountpoint -q "$d" && ln -sT "$d" /media/USBdrive$i + test -e /media/USBdrive$i || test -d "$d" && ln -sT "$d" /media/USBdrive$i fi i=$(( i + 1 )) done @@ -265,6 +265,32 @@ EOF sed -i 's|^ExecStartPre=/bin/sleep .*|ExecStartPre=/bin/sleep 20|' /lib/systemd/system/mariadb.service sed -i 's|^Restart=.*|Restart=on-failure|' /lib/systemd/system/mariadb.service + # fix for nc-automount-links + cat > /usr/local/etc/nc-automount-links <<'EOF' +#!/bin/bash + +ls -d /media/* &>/dev/null && { + + # remove old links + for l in $( ls /media/ ); do + test -L /media/"$l" && rm /media/"$l" + done + + # create links + i=0 + for d in $( ls -d /media/* 2>/dev/null ); do + if [ $i -eq 0 ]; then + test -e /media/USBdrive || test -d "$d" && ln -sT "$d" /media/USBdrive + else + test -e /media/USBdrive$i || test -d "$d" && ln -sT "$d" /media/USBdrive$i + fi + i=$(( i + 1 )) + done + +} +EOF + chmod +x /usr/local/etc/nc-automount-links + } # end - only live updates exit 0 |