misc cleanup
authorMike Baker <mbm@openwrt.org>
Wed, 20 Jul 2005 20:20:01 +0000 (20:20 +0000)
committerMike Baker <mbm@openwrt.org>
Wed, 20 Jul 2005 20:20:01 +0000 (20:20 +0000)
SVN-Revision: 1505

openwrt/target/default/target_skeleton/etc/firewall.user
openwrt/target/default/target_skeleton/etc/init.d/S10boot
openwrt/target/default/target_skeleton/etc/init.d/rcS
openwrt/target/default/target_skeleton/etc/preinit

index 1781bd4ea04fd483790198490e55adbbf1f80dbf..7a13141623a659bfd9ba5cda188b7e02866ccf23 100755 (executable)
@@ -14,7 +14,7 @@ iptables -t nat -F postrouting_rule
 ### The "-i $WAN" literally means packets that came in over the $WAN interface;
 ### this WILL NOT MATCH packets sent from the LAN to the WAN address.
 
-### Allow SSH from WAN
+### Allow SSH on the WAN interface
 # iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport 22 -j ACCEPT 
 # iptables        -A input_rule      -i $WAN -p tcp --dport 22 -j ACCEPT
 
index 22096d5fbb3554a3a20afb116933afd91bde2c65..ead73521b12d032aeb6e9e832a43ec535c2f4ce2 100755 (executable)
@@ -16,7 +16,8 @@ touch /var/log/lastlog
 # if they don't already exist 
 [  "$(nvram get boardtype)" = "bcm95365r" \
 -a "$(nvram get boardnum)" = "45" \
--a -z "$(nvram get vlan0ports)$(nvram get vlan1ports)" ] && {
+-a -z "$(nvram get vlan0ports)"
+-a -z "$(nvram get vlan1ports)" ] && {
        nvram set vlan0ports="1 2 3 4 5*"
        nvram set vlan1ports="0 5"
 }
@@ -33,6 +34,6 @@ echo ${HOSTNAME:=OpenWrt}>/proc/sys/kernel/hostname
 vconfig set_name_type VLAN_PLUS_VID_NO_PAD
 
 # automagically run firstboot
-[ -z "$FAILSAFE" ] && {
+[ -z "$FAILSAFE" -a -z "$(nvram get no_root_swap)" ] && {
        { mount|grep "on / type jffs2" 1>&-; } || firstboot
 }
index 969fefe937e4f6a6d4dda8013d23458207d12f24..706585801ce4c31aa28d182ad92b9e4e5e4eaf3b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 syslog_ip=$(nvram get log_ipaddr)
-ipcalc -s $syslog_ip || syslog_ip=""
+ipcalc -s "$syslog_ip" || syslog_ip=""
 syslogd -C 16 ${syslog_ip:+-L -R $syslog_ip}
 klogd
 #${FAILSAFE:+telnetd -l /bin/login; ifup lan; exit}
index 0c59893f75fe0065448088bdd8fc8299bfcbea22..b23f8833ef0a4c368af13bb5cae458cd32e9cc48 100755 (executable)
@@ -1,17 +1,18 @@
 #!/bin/sh
+export PATH=/bin:/sbin:/usr/bin:/usr/sbin
 mount none /proc -t proc
 insmod diag
 echo 0x01 > /proc/sys/diag
 sleep 1
-if [ $(cat /proc/sys/reset) = 1 ] || [ "$(/usr/sbin/nvram get failsafe)" = 1 ]; then
+if [ $(cat /proc/sys/reset) = 1 -o "$(nvram get failsafe)" = 1 ]; then
        export FAILSAFE=true
-       [ "$(/usr/sbin/nvram get boot_wait)" != "on" ] && {
-               /usr/sbin/nvram set boot_wait=on
-               /usr/sbin/nvram commit
+       [ "$(nvram get boot_wait)" != "on" ] && {
+               nvram set boot_wait=on
+               nvram commit
        }
        while :; do { echo $(((X=(X+1)%8)%2)) > /proc/sys/diag; sleep $((X==0)); } done &
 fi
 
-/sbin/mount_root ${FAILSAFE:+failsafe}
+mount_root ${FAILSAFE:+failsafe}
 
 exec /sbin/init