Skip to content

Commit

Permalink
make the shared dir configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
nlf committed Jan 27, 2016
1 parent d9185cd commit 1c17796
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 14 additions & 4 deletions rootfs/etc/init.d/S41automount-nfs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

start() {
echo -n "Mounting NFS share:"
local share=$(cat /proc/cmdline | sed -n 's/^.*share=\([^ ]\+\).*$/\1/p')
if [ -z "$share" ]; then
share="/Users"
fi

local timer=0
local gateway=""
while [ "$timer" -lt 10 -a -z "$gateway" ]; do
Expand All @@ -14,17 +19,22 @@ start() {
done

if [ -n "$gateway" ]; then
mkdir -p /Users
mount ${gateway}:/Users /Users -o rw,async,noatime,rsize=32768,wsize=32768,proto=tcp
mkdir -p "$share"
mount ${gateway}:"$share" "$share" -o rw,async,noatime,rsize=32768,wsize=32768,proto=tcp
echo "OK"
else
echo "FAIL"
fi
}

stop() {
if [ -d /Users ]; then
umount -f /Users
local share=$(cat /proc/cmdline | sed -n 's/^.*share=\([^ ]\+\).*$/\1/p')
if [ -z "$share" ]; then
share="/Users"
fi

if [ -d "$share" ]; then
umount -f "$share"
fi
}

Expand Down
2 changes: 1 addition & 1 deletion rootfs/etc/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
2.1.0

0 comments on commit 1c17796

Please sign in to comment.