diff --git a/samba_off.sh b/samba_off.sh index 1aee235..cade34c 100644 --- a/samba_off.sh +++ b/samba_off.sh @@ -25,7 +25,7 @@ -if [ ! -f "/media/fat/MiSTer" ]; +if [ ! -f "/media/fat/MiSTer" ]; then echo "This script must be run" echo "on a MiSTer system." @@ -33,6 +33,9 @@ then fi /etc/init.d/S91smb stop 2> /dev/null + +[ -f "/media/fat/linux/samba.sh" ] && mv /media/fat/linux/{,_}samba.sh + mount | grep -q "on / .*[(,]ro[,$]" && RO_ROOT="true" [ "$RO_ROOT" == "true" ] && mount / -o remount,rw mv /etc/init.d/S91smb /etc/init.d/_S91smb > /dev/null 2>&1 @@ -54,4 +57,4 @@ fi echo "Samba is off and" echo "inactive at startup." echo "Done!" -exit 0 \ No newline at end of file +exit 0 diff --git a/samba_on.sh b/samba_on.sh index 8ec42db..8e29dfc 100644 --- a/samba_on.sh +++ b/samba_on.sh @@ -25,13 +25,15 @@ -if [ ! -f "/media/fat/MiSTer" ]; +if [ ! -f "/media/fat/MiSTer" ]; then echo "This script must be run" echo "on a MiSTer system." exit 1 fi +[ -f "/media/fat/linux/_samba.sh" ] && mv /media/fat/linux/{_,}samba.sh + mount | grep "on / .*[(,]ro[,$]" -q && RO_ROOT="true" [ "$RO_ROOT" == "true" ] && mount / -o remount,rw mv /etc/init.d/_S91smb /etc/init.d/S91smb > /dev/null 2>&1 @@ -54,4 +56,4 @@ fi echo "Samba is on and" echo "active at startup." echo "Done!" -exit 0 \ No newline at end of file +exit 0