From bfaa4cb6f05b86f7d4d18e0ccab6e49c02d3d52d Mon Sep 17 00:00:00 2001 From: Robert Bays Date: Wed, 5 Dec 2007 12:38:40 -0800 Subject: add link-detect to interfaces by default on interface discovery --- scripts/rl-system.init | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/scripts/rl-system.init b/scripts/rl-system.init index 8d933b2d..82451b60 100755 --- a/scripts/rl-system.init +++ b/scripts/rl-system.init @@ -194,7 +194,19 @@ add_bootfile_eth_hwid () }' $BOOTFILE } -update_bootfile_eth_hwid () +add_bootfile_eth_linkdetect () +{ + local eth=$1 + + sed -i '/^interfaces {$/,/^}$/ { + /^}$/i\ + ethernet '"$eth"' {\ + link-detect\ + } + }' $BOOTFILE +} + +update_bootfile_eths () { local -i i @@ -203,6 +215,7 @@ update_bootfile_eth_hwid () mod_bootfile_eth_hwid eth$i ${cfg_eth_hwid[$i]} else add_bootfile_eth_hwid eth$i ${cfg_eth_hwid[$i]} + add_bootfile_eth_linkdetect eth$i fi done } @@ -234,7 +247,7 @@ itfmess () load_sys_vmnets update_cfg_eth_hwid write_iftab - update_bootfile_eth_hwid + update_bootfile_eths update_bootfile_vmnets } -- cgit v1.2.3 From 1041db879c6bdfa86f6a8b19e1542475db6dffc9 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Wed, 5 Dec 2007 20:18:58 -0800 Subject: add "allow-root" option for telnet (default "false"). --- templates/service/telnet/allow-root/node.def | 10 ++++++++++ templates/service/telnet/port/node.def | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 templates/service/telnet/allow-root/node.def diff --git a/templates/service/telnet/allow-root/node.def b/templates/service/telnet/allow-root/node.def new file mode 100644 index 00000000..654023af --- /dev/null +++ b/templates/service/telnet/allow-root/node.def @@ -0,0 +1,10 @@ +type: bool +default: false +help: "Enable/disable root login" +update: "if [ \"$(@)\" == \"true\" ]; then \ + sudo mv -f /etc/securetty /etc/securetty.allow-root >&/dev/null; \ + else + sudo mv -f /etc/securetty.allow-root /etc/securetty >&/dev/null; \ + fi ; /bin/true" +delete: "sudo mv -f /etc/securetty.allow-root /etc/securetty >&/dev/null ; \ + /bin/true" diff --git a/templates/service/telnet/port/node.def b/templates/service/telnet/port/node.def index 0232af83..d9bbce6c 100644 --- a/templates/service/telnet/port/node.def +++ b/templates/service/telnet/port/node.def @@ -1,3 +1,3 @@ -type: u32 +type: u32 default: 23 help: "Port for telnet service" -- cgit v1.2.3 From 5ba8cf8393030d75c03a15551a57831f3f0908a4 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Fri, 7 Dec 2007 18:37:56 -0800 Subject: fix ifrename problem: make sure there's no interface name overlap, and don't use "-t" with ifrename. --- scripts/rl-system.init | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/rl-system.init b/scripts/rl-system.init index 82451b60..779a7610 100755 --- a/scripts/rl-system.init +++ b/scripts/rl-system.init @@ -165,6 +165,16 @@ write_iftab () { local -i i + rm -f $IFTAB + for i in ${!cfg_eth_hwid[@]} ; do + echo "etha$i mac ${cfg_eth_hwid[$i]}" >> $IFTAB + done +} + +write_iftab_real () +{ + local -i i + rm -f $IFTAB for i in ${!cfg_eth_hwid[@]} ; do echo "eth$i mac ${cfg_eth_hwid[$i]}" >> $IFTAB @@ -253,7 +263,7 @@ itfmess () maybe_ifrename () { if [ -e $IFTAB ] ; then - ifrename -d -p -t + ifrename -d -p fi } @@ -324,6 +334,8 @@ start () { set_reboot_on_panic itfmess maybe_ifrename + write_iftab_real + maybe_ifrename add_new_serial_if reset_promiscous_arp_response set_ip_forwarding -- cgit v1.2.3