Skip to content

Commit

Permalink
fix for nc-automount-links
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Mar 16, 2018
1 parent b3be948 commit 38dfa60
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
4 changes: 3 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions etc/nextcloudpi-config.d/nc-automount.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 26 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 38dfa60

Please sign in to comment.