2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # This copyright note is auto-generated by scripts/Create-CopyPatch.
5 # T2 SDE: package/*/rocknet/ifup.sh
6 # Copyright (C) 2004 - 2021 The T2 SDE Project
8 # More information can be found in the files COPYING and README.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; version 2 of the License. A copy of the
13 # GNU General Public License can be found in the file COPYING.
14 # --- T2-COPYRIGHT-NOTE-END ---
16 rocknet_tmp_base
="/var/run/rocknet"
17 [ -d $rocknet_tmp_base ] || mkdir
-p $rocknet_tmp_base
23 [ "${tmp/$3$2/}" != "$tmp" ]
27 echo "Usage: $0 interface [ profile ] [ -force ]"
33 if="$1" ; shift ; [ "$if" ] || usage
40 *) [ "$profile" = "" ] && profile
="$1" || usage
;;
45 [ "$profile" ] || profile
="`cat /etc/conf/network-profile 2> /dev/null`"
46 profile
=${profile:-default}
50 if [ $force -eq 0 ] ; then
51 active_interfaces
="`cat $rocknet_tmp_base/active-interfaces 2>/dev/null`"
53 if test $action = "up" && var_contains active_interfaces
',' "$if($profile)"
55 echo "Interface $if($profile) is already listed active, it is probably a good idea to"
56 echo "take it down before activating it. Use -force to suppress this warning."
60 if test $action = "down" && ! var_contains active_interfaces
',' "$if($profile)"
62 echo "Interface $if($profile) is not listed active, it is probably a good idea to"
63 echo "activate it before deactivating it. Use -force to suppress this warning."
68 /sbin
/rocknet
"$profile" "$if" "$action"
69 echo "$profile" > /etc
/conf
/network-profile