1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../udhcp/rocknet_udhcp.sh
5 # Copyright (C) 2004 - 2005 The T2 SDE Project
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 as published by
11 # the Free Software Foundation; version 2 of the License. A copy of the
12 # GNU General Public License can be found in the file COPYING.
13 # --- T2-COPYRIGHT-NOTE-END ---
17 local HOSTNAME
="`hostname`" cmdline
=
18 [ "$HOSTNAME" == "(none)" ] && HOSTNAME
=
20 [ "$CANUSESERVICE" == "1" ] && cmdline
="exec "
22 cmdline
="$cmdline /usr/sbin/udhcpc ${HOSTNAME:+-h $HOSTNAME} -i $if"
23 cmdline
="$cmdline -s /etc/udhcp/t2-default.script"
25 while [ $# -ge 1 ]; do
28 *) echo "WARNING: udhcp doesn't understand '$1'"
34 if [ "$opt_nodns" ]; then
35 cmdline
="export UPDATE_RESOLVCONF=0;
39 if [ "$CANUSESERVICE" == "1" ]; then
40 addcode up
5 1 "service_create $if '$cmdline -f' \
41 'sleep 2 ; ip link set $if down'"
42 addcode down
5 1 "service_destroy $if"
44 addcode up
5 5 "$cmdline"
45 addcode down
5 5 "killall -TERM udhcpc"
46 addcode down
5 5 "sleep 2 ; ip link set $if down"