diff options
author | nachoparker <nacho@ownyourbits.com> | 2017-09-02 12:53:33 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2017-09-02 12:55:01 +0300 |
commit | 3393477268a8e0e8edf76e11d36225d6114edf65 (patch) | |
tree | 089cbd5a392400ca8ae036f39494ed9853ecead4 /etc/nextcloudpi-config.d/nc-automount.sh | |
parent | ee748758713a746863d6936e65bb1051d82507ef (diff) |
nc-automount: improve linksv0.25.2
Diffstat (limited to 'etc/nextcloudpi-config.d/nc-automount.sh')
-rw-r--r-- | etc/nextcloudpi-config.d/nc-automount.sh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/etc/nextcloudpi-config.d/nc-automount.sh b/etc/nextcloudpi-config.d/nc-automount.sh index 18fba5b9..fb593aed 100644 --- a/etc/nextcloudpi-config.d/nc-automount.sh +++ b/etc/nextcloudpi-config.d/nc-automount.sh @@ -71,11 +71,14 @@ ls -d /media/* &>/dev/null && { # create links i=0 for d in `ls -d /media/*`; do - [ $i -eq 0 ] && \ - ln -sT "$d" /media/USBdrive || \ - ln -sT "$d" /media/USBdrive$i + if [ $i -eq 0 ]; then + mountpoint -q "$d" && ln -sT "$d" /media/USBdrive + else + mountpoint -q "$d" && ln -sT "$d" /media/USBdrive$i + fi i=$(( i + 1 )) done + } EOF chmod +x /usr/local/etc/nc-automount-links |