2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # T2 SDE: package/*/rocknet/ifup.sh
4 # Copyright (C) 2004 - 2022 The T2 SDE Project
6 # This Copyright note is generated by scripts/Create-CopyPatch,
7 # more information can be found in the files COPYING and README.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License version 2.
11 # --- T2-COPYRIGHT-NOTE-END ---
13 rocknet_tmp_base
="/var/run/rocknet"
14 [ -d $rocknet_tmp_base ] || mkdir
-p $rocknet_tmp_base
20 [ "${tmp/$3$2/}" != "$tmp" ]
24 echo "Usage: $0 interface [ profile ] [ -force ]"
30 if="$1" ; shift ; [ "$if" ] || usage
37 *) [ "$profile" = "" ] && profile
="$1" || usage
;;
42 [ "$profile" ] || profile
="`cat /etc/conf/network-profile 2> /dev/null`"
43 profile
=${profile:-default}
47 if [ $force -eq 0 ]; then
48 active_interfaces
="`cat $rocknet_tmp_base/active-interfaces 2>/dev/null`"
50 if test $action = "up" && var_contains active_interfaces
',' "$if($profile)"
52 echo "Interface $if($profile) is already listed active, it is probably a good idea to"
53 echo "take it down before activating it. Use -force to suppress this warning."
57 if test $action = "down" && ! var_contains active_interfaces
',' "$if($profile)"
59 echo "Interface $if($profile) is not listed active, it is probably a good idea to"
60 echo "activate it before deactivating it. Use -force to suppress this warning."
65 /sbin
/rocknet
"$profile" "$if" "$action"
66 echo "$profile" > /etc
/conf
/network-profile