Version 1.0.2

Remounting / as RW only when needed; downgraded version from 1.1 to 1.0.2.
This commit is contained in:
Locutus73
2019-02-03 12:14:45 +01:00
committed by GitHub
parent b6f1fc9158
commit b5607c1048
8 changed files with 43 additions and 27 deletions

View File

@@ -18,7 +18,8 @@
# You can download the latest version of this script from:
# https://github.com/MiSTer-devel/Scripts_MiSTer
# Version 1.1 - 2019-02-02 - Remounting / as RW before altering /etc/init.d/ so the script actually works from OSD.
# Version 1.0.2 - 2019-02-03 - Remounting / as RW only when needed; downgraded version from 1.1 to 1.0.2.
# Version 1.0.1 - 2019-02-02 - Remounting / as RW before altering /etc/init.d/ so the script actually works from OSD.
# Version 1.0 - 2019-02-02 - First commit
@@ -31,10 +32,11 @@ then
fi
echo "*filter"$'\n'"COMMIT" | iptables-restore
mount / -o remount,rw
mount | grep -q "on / .*[(,]ro[,$]" && RO_ROOT="true"
[ "$RO_ROOT" == "true" ] && mount / -o remount,rw
rm /etc/network/if-pre-up.d/iptables > /dev/null 2>&1
sync
mount / -o remount,ro
[ "$RO_ROOT" == "true" ] && mount / -o remount,ro
echo "Firewall is off and"
echo "inactive at startup."

View File

@@ -18,7 +18,8 @@
# You can download the latest version of this script from:
# https://github.com/MiSTer-devel/Scripts_MiSTer
# Version 1.1 - 2019-02-02 - Remounting / as RW before altering /etc/init.d/ so the script actually works from OSD.
# Version 1.0.2 - 2019-02-03 - Remounting / as RW only when needed; downgraded version from 1.1 to 1.0.2.
# Version 1.0.1 - 2019-02-02 - Remounting / as RW before altering /etc/init.d/ so the script actually works from OSD.
# Version 1.0 - 2019-02-02 - First commit
@@ -103,11 +104,12 @@ then
IPTABLES_UP_RULES=$IPTABLES_UP_RULES$'\n'"COMMIT"
echo "$IPTABLES_UP_RULES" > /media/fat/linux/iptables.up.rules
fi
mount / -o remount,rw
mount | grep "on / .*[(,]ro[,$]" -q && RO_ROOT="true"
[ "$RO_ROOT" == "true" ] && mount / -o remount,rw
echo "#!/bin/bash"$'\n'"iptables-restore < /media/fat/linux/iptables.up.rules" > /etc/network/if-pre-up.d/iptables
chmod +x /etc/network/if-pre-up.d/iptables
sync
mount / -o remount,ro
[ "$RO_ROOT" == "true" ] && mount / -o remount,ro
/etc/network/if-pre-up.d/iptables
echo "Firewall is on and"

View File

@@ -18,7 +18,8 @@
# You can download the latest version of this script from:
# https://github.com/MiSTer-devel/Scripts_MiSTer
# Version 1.1 - 2019-02-02 - Remounting / as RW before altering /etc/init.d/ so the script actually works from OSD.
# Version 1.0.2 - 2019-02-03 - Remounting / as RW only when needed; downgraded version from 1.1 to 1.0.2.
# Version 1.0.1 - 2019-02-02 - Remounting / as RW before altering /etc/init.d/ so the script actually works from OSD.
# Version 1.0 - 2019-02-02 - First commit
@@ -30,11 +31,12 @@ then
exit 1
fi
/etc/init.d/S50proftpd stop
mount / -o remount,rw
/etc/init.d/S50proftpd stop 2> /dev/null
mount | grep -q "on / .*[(,]ro[,$]" && RO_ROOT="true"
[ "$RO_ROOT" == "true" ] && mount / -o remount,rw
mv /etc/init.d/S50proftpd /etc/init.d/_S50proftpd > /dev/null 2>&1
sync
mount / -o remount,ro
[ "$RO_ROOT" == "true" ] && mount / -o remount,ro
if [ -f /media/fat/linux/iptables.up.rules ]
then
sed -e '/--dport 21 /s/^#*/#/g' -i /media/fat/linux/iptables.up.rules

View File

@@ -18,7 +18,8 @@
# You can download the latest version of this script from:
# https://github.com/MiSTer-devel/Scripts_MiSTer
# Version 1.1 - 2019-02-02 - Remounting / as RW before altering /etc/init.d/ so the script actually works from OSD.
# Version 1.0.2 - 2019-02-03 - Remounting / as RW only when needed; downgraded version from 1.1 to 1.0.2.
# Version 1.0.1 - 2019-02-02 - Remounting / as RW before altering /etc/init.d/ so the script actually works from OSD.
# Version 1.0 - 2019-02-02 - First commit
@@ -30,10 +31,11 @@ then
exit 1
fi
mount / -o remount,rw
mount | grep "on / .*[(,]ro[,$]" -q && RO_ROOT="true"
[ "$RO_ROOT" == "true" ] && mount / -o remount,rw
mv /etc/init.d/_S50proftpd /etc/init.d/S50proftpd > /dev/null 2>&1
sync
mount / -o remount,ro
[ "$RO_ROOT" == "true" ] && mount / -o remount,ro
if [ -f /media/fat/linux/iptables.up.rules ]
then
sed -e '/--dport 21 /s/^#//g' -i /media/fat/linux/iptables.up.rules

View File

@@ -18,7 +18,8 @@
# You can download the latest version of this script from:
# https://github.com/MiSTer-devel/Scripts_MiSTer
# Version 1.1 - 2019-02-02 - Remounting / as RW before altering /etc/init.d/ so the script actually works from OSD.
# Version 1.0.2 - 2019-02-03 - Remounting / as RW only when needed; downgraded version from 1.1 to 1.0.2.
# Version 1.0.1 - 2019-02-02 - Remounting / as RW before altering /etc/init.d/ so the script actually works from OSD.
# Version 1.0 - 2019-02-02 - First commit
@@ -30,11 +31,12 @@ then
exit 1
fi
/etc/init.d/S91smb stop
mount / -o remount,rw
/etc/init.d/S91smb stop 2> /dev/null
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
sync
mount / -o remount,ro
[ "$RO_ROOT" == "true" ] && mount / -o remount,ro
if [ -f /media/fat/linux/iptables.up.rules ]
then
sed -e '/--dport 137 /s/^#*/#/g' -i /media/fat/linux/iptables.up.rules

View File

@@ -18,7 +18,8 @@
# You can download the latest version of this script from:
# https://github.com/MiSTer-devel/Scripts_MiSTer
# Version 1.1 - 2019-02-02 - Remounting / as RW before altering /etc/init.d/ so the script actually works from OSD.
# Version 1.0.2 - 2019-02-03 - Remounting / as RW only when needed; downgraded version from 1.1 to 1.0.2.
# Version 1.0.1 - 2019-02-02 - Remounting / as RW before altering /etc/init.d/ so the script actually works from OSD.
# Version 1.0 - 2019-02-02 - First commit
@@ -30,10 +31,11 @@ then
exit 1
fi
mount / -o remount,rw
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
sync
mount / -o remount,ro
[ "$RO_ROOT" == "true" ] && mount / -o remount,ro
if [ -f /media/fat/linux/iptables.up.rules ]
then
sed -e '/--dport 137 /s/^#//g' -i /media/fat/linux/iptables.up.rules

View File

@@ -18,7 +18,8 @@
# You can download the latest version of this script from:
# https://github.com/MiSTer-devel/Scripts_MiSTer
# Version 1.1 - 2019-02-02 - Remounting / as RW before altering /etc/init.d/ so the script actually works from OSD.
# Version 1.0.2 - 2019-02-03 - Remounting / as RW only when needed; downgraded version from 1.1 to 1.0.2.
# Version 1.0.1 - 2019-02-02 - Remounting / as RW before altering /etc/init.d/ so the script actually works from OSD.
# Version 1.0 - 2019-02-02 - First commit
@@ -30,11 +31,12 @@ then
exit 1
fi
/etc/init.d/S50sshd stop
mount / -o remount,rw
/etc/init.d/S50sshd stop 2> /dev/null
mount | grep -q "on / .*[(,]ro[,$]" && RO_ROOT="true"
[ "$RO_ROOT" == "true" ] && mount / -o remount,rw
mv /etc/init.d/S50sshd /etc/init.d/_S50sshd > /dev/null 2>&1
sync
mount / -o remount,ro
[ "$RO_ROOT" == "true" ] && mount / -o remount,ro
if [ -f /media/fat/linux/iptables.up.rules ]
then
sed -e '/--dport 22 /s/^#*/#/g' -i /media/fat/linux/iptables.up.rules

View File

@@ -18,7 +18,8 @@
# You can download the latest version of this script from:
# https://github.com/MiSTer-devel/Scripts_MiSTer
# Version 1.1 - 2019-02-02 - Remounting / as RW before altering /etc/init.d/ so the script actually works from OSD.
# Version 1.0.2 - 2019-02-03 - Remounting / as RW only when needed; downgraded version from 1.1 to 1.0.2.
# Version 1.0.1 - 2019-02-02 - Remounting / as RW before altering /etc/init.d/ so the script actually works from OSD.
# Version 1.0 - 2019-02-02 - First commit
@@ -30,10 +31,11 @@ then
exit 1
fi
mount / -o remount,rw
mount | grep "on / .*[(,]ro[,$]" -q && RO_ROOT="true"
[ "$RO_ROOT" == "true" ] && mount / -o remount,rw
mv /etc/init.d/_S50sshd /etc/init.d/S50sshd > /dev/null 2>&1
sync
mount / -o remount,ro
[ "$RO_ROOT" == "true" ] && mount / -o remount,ro
if [ -f /media/fat/linux/iptables.up.rules ]
then
sed -e '/--dport 22 /s/^#//g' -i /media/fat/linux/iptables.up.rules