summaryrefslogtreecommitdiffstats
path: root/package/base-files/default/etc
diff options
context:
space:
mode:
authormbm <mbm@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-07-20 19:58:40 +0000
committermbm <mbm@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-07-20 19:58:40 +0000
commita44985f42c551baae99a2c6f461c94ec86d9e310 (patch)
tree702dae2c4cb6b1e26b3c135cc3f3116b76dd5d84 /package/base-files/default/etc
parent1d0d06f7a65d38875139a77b2529c62cd3bc487a (diff)
updates from whiterussian
git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@1504 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/default/etc')
-rwxr-xr-xpackage/base-files/default/etc/firewall.user2
-rwxr-xr-xpackage/base-files/default/etc/init.d/S10boot5
-rwxr-xr-xpackage/base-files/default/etc/init.d/S45firewall1
-rwxr-xr-xpackage/base-files/default/etc/init.d/rcS7
-rwxr-xr-xpackage/base-files/default/etc/preinit11
5 files changed, 15 insertions, 11 deletions
diff --git a/package/base-files/default/etc/firewall.user b/package/base-files/default/etc/firewall.user
index 1781bd4ea..7a1314162 100755
--- a/package/base-files/default/etc/firewall.user
+++ b/package/base-files/default/etc/firewall.user
@@ -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
diff --git a/package/base-files/default/etc/init.d/S10boot b/package/base-files/default/etc/init.d/S10boot
index 22096d5fb..ead73521b 100755
--- a/package/base-files/default/etc/init.d/S10boot
+++ b/package/base-files/default/etc/init.d/S10boot
@@ -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
}
diff --git a/package/base-files/default/etc/init.d/S45firewall b/package/base-files/default/etc/init.d/S45firewall
index 8350ccbfe..cb779792d 100755
--- a/package/base-files/default/etc/init.d/S45firewall
+++ b/package/base-files/default/etc/init.d/S45firewall
@@ -1,6 +1,7 @@
#!/bin/sh
## Please make changes in /etc/firewall.user
+${FAILSAFE:+exit}
. /etc/functions.sh
WAN=$(nvram get wan_ifname)
diff --git a/package/base-files/default/etc/init.d/rcS b/package/base-files/default/etc/init.d/rcS
index e6daddc59..706585801 100755
--- a/package/base-files/default/etc/init.d/rcS
+++ b/package/base-files/default/etc/init.d/rcS
@@ -1,8 +1,9 @@
#!/bin/sh
-syslogd -C 16
+syslog_ip=$(nvram get log_ipaddr)
+ipcalc -s "$syslog_ip" || syslog_ip=""
+syslogd -C 16 ${syslog_ip:+-L -R $syslog_ip}
klogd
-${FAILSAFE:+telnetd -l /bin/login; ifup lan; exit}
-
+#${FAILSAFE:+telnetd -l /bin/login; ifup lan; exit}
for i in /etc/init.d/S*; do
$i start 2>&1
done | logger -s -p 6 -t '' &
diff --git a/package/base-files/default/etc/preinit b/package/base-files/default/etc/preinit
index 0c59893f7..b23f8833e 100755
--- a/package/base-files/default/etc/preinit
+++ b/package/base-files/default/etc/preinit
@@ -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