diff --git a/package/base/sysfiles/rocknet.sh b/package/base/sysfiles/rocknet.sh index f603c5382..a2bedfc9b 100755 --- a/package/base/sysfiles/rocknet.sh +++ b/package/base/sysfiles/rocknet.sh @@ -14,6 +14,7 @@ code_snipplets_counter=0 lineno=0 ignore=0 global=1 +retcode=0 if [ "$3" != "up" -a "$3" != "down" ]; then echo "Usage: $0 { profile | default } { interface | auto } { up | down }" @@ -56,6 +57,7 @@ isfirst() { # error() { echo "$*" + retcode=1 } status() { @@ -115,3 +117,4 @@ done < <( [ "$pmatched" = 1 -a "$imatched" = 0 ] && \ error "Unknown interface for profile: '$interface'" +exit $retcode diff --git a/package/base/sysfiles/rocknet_config b/package/base/sysfiles/rocknet_config new file mode 100644 index 000000000..814feeee2 --- /dev/null +++ b/package/base/sysfiles/rocknet_config @@ -0,0 +1,24 @@ +# +# ROCKNET Example Config File +# +# The file /etc/network/README contains a detailed description of most +# available config directives for this file. +# +# Check out the modules in /etc/network/modules/* directly for information +# about the not so-well documented directives (such as directives from 3rd +# party modules). +# + + +### automatically set up interface eth0 on startup +# auto eth0 + +### interface eth0 is configured using DHCP +# interface eth0 +# dhcp + +### interface eth0 is configured using a static IP +# interface eth1 +# ip 192.168.100.99/24 +# gw 192.168.100.1 + diff --git a/package/base/sysfiles/sysfiles.conf b/package/base/sysfiles/sysfiles.conf index e7d332a1b..75cae3ec6 100644 --- a/package/base/sysfiles/sysfiles.conf +++ b/package/base/sysfiles/sysfiles.conf @@ -67,7 +67,7 @@ EOT echo "Installing the rock-net tool ..." cp -v $confdir/rocknet.sh etc/network/rocknet chmod +x etc/network/rocknet - for x in $( cd $confdir; echo rocknet_{*.sh,README,getprofile}; ); do + for x in $( cd $confdir; echo rocknet_{*.sh,README,config,getprofile}; ); do dst="${x#rocknet_}"; z="/"; dst="${dst//_/$z}" cp -vf $confdir/$x etc/network/$dst done