Update how samba is enabled/disabled (#130)

This commit is contained in:
Dave Wongillies
2026-03-11 22:44:34 -07:00
committed by GitHub
parent 6b875d49b4
commit 9ae636183e
2 changed files with 9 additions and 4 deletions

View File

@@ -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
exit 0

View File

@@ -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
exit 0