summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <uberlord@gentoo.org>2007-04-05 15:11:50 +0000
committerRoy Marples <uberlord@gentoo.org>2007-04-05 15:11:50 +0000
commit605c61addc02fd4d984bae70d2d4a694d3b52520 (patch)
tree55435018d218d6c3bba2fd2664baf6c22b4c7bb4 /net-misc/udhcp
parentVersion bump to 3.4.7 of genkernel. This resolves bug #148253, bug #156009, ... (diff)
downloadgentoo-2-605c61addc02fd4d984bae70d2d4a694d3b52520.tar.gz
gentoo-2-605c61addc02fd4d984bae70d2d4a694d3b52520.tar.bz2
gentoo-2-605c61addc02fd4d984bae70d2d4a694d3b52520.zip
Work on all shells
(Portage version: 2.1.2.3)
Diffstat (limited to 'net-misc/udhcp')
-rw-r--r--net-misc/udhcp/files/udhcpc.sh38
1 files changed, 19 insertions, 19 deletions
diff --git a/net-misc/udhcp/files/udhcpc.sh b/net-misc/udhcp/files/udhcpc.sh
index 83cb1d9d1470..14530833d40b 100644
--- a/net-misc/udhcp/files/udhcpc.sh
+++ b/net-misc/udhcp/files/udhcpc.sh
@@ -8,25 +8,25 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin
update_dns()
{
- [[ -n "${PEER_DNS}" ]] && [[ "${PEER_DNS}" != "yes" ]] && return
- [[ -z "${domain}" ]] && [[ -z "${dns}" ]] && return
+ [ -n "${PEER_DNS}" ] && [ "${PEER_DNS}" != "yes" ] && return
+ [ -z "${domain}" ] && [ -z "${dns}" ] && return
conf="# Generated by udhcpc for ${interface}\n"
- [[ -n "${domain}" ]] && conf="${conf}search ${domain}\n"
+ [ -n "${domain}" ] && conf="${conf}search ${domain}\n"
for i in ${dns} ; do
conf="${conf}nameserver ${i}\n"
done
- if [[ -x /sbin/resolvconf ]] ; then
- echo -e "${conf}" | resolvconf -a ${interface}
+ if [ -x /sbin/resolvconf ] ; then
+ printf "${conf}" | resolvconf -a ${interface}
else
- echo -e "${conf}" > /etc/resolv.conf
+ printf "${conf}" > /etc/resolv.conf
chmod 644 /etc/resolv.conf
fi
}
update_ntp() {
- [[ -n "${PEER_NTP}" ]] && [[ "${PEER_NTP}" != "yes" ]] && return
- [[ -z "${ntpsrv}" ]] && return
+ [ -n "${PEER_NTP}" ] && [ "${PEER_NTP}" != "yes" ] && return
+ [ -z "${ntpsrv}" ] && return
conf="# Generated by udhcpc for interface ${interface}\n"
conf="${conf}restrict default noquery notrust nomodify\n"
@@ -37,23 +37,23 @@ update_ntp() {
done
conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
conf="${conf}logfile /var/log/ntp.log\n"
- echo -e "${conf}" > /etc/ntp.conf
+ printf "${conf}" > /etc/ntp.conf
chmod 644 /etc/ntp.conf
}
update_hostname() {
- [[ -n "${PEER_HOSTNAME}" ]] && [[ "${PEER_HOSTNAME}" != "yes" ]] && return
- [[ -z "${hostname}" ]] && return
+ [ -n "${PEER_HOSTNAME}" ] && [ "${PEER_HOSTNAME}" != "yes" ] && return
+ [ -z "${hostname}" ] && return
myhost="$(hostname)"
- [[ -z ${myhost} ]] || [[ ${myhost} == "(none)" ]] && hostname "${hostname}"
+ [ -z "${myhost}" ] || [ "${myhost}" = "(none)" ] && hostname "${hostname}"
}
update_interface()
{
- [[ -n "${broadcast}" ]] && broadcast="broadcast ${broadcast}"
- [[ -n "${subnet}" ]] && netmask="netmask ${subnet}"
- [[ -n "${mtu}" ]] && mtu="mtu ${mtu}"
+ [ -n "${broadcast}" ] && broadcast="broadcast ${broadcast}"
+ [ -n "${subnet}" ] && netmask="netmask ${subnet}"
+ [ -n "${mtu}" ] && mtu="mtu ${mtu}"
ifconfig "${interface}" ${ip} ${broadcast} ${netmask} ${mtu}
}
@@ -63,11 +63,11 @@ update_routes()
:
done
- [[ -n "${PEER_ROUTERS}" ]] && [[ "${PEER_ROUTERS}" != "yes" ]] && return
+ [ -n "${PEER_ROUTERS}" ] && [ "${PEER_ROUTERS}" != "yes" ] && return
- if [[ -n "${router}" ]] ; then
+ if [ -n "${router}" ] ; then
metric=
- [[ -n "${IF_METRIC}" ]] && metric="metric ${IF_METRIC}"
+ [ -n "${IF_METRIC}" ] && metric="metric ${IF_METRIC}"
for i in ${router} ; do
route add default gw "${i}" ${metric} dev "${interface}"
done
@@ -77,7 +77,7 @@ update_routes()
deconfig()
{
ifconfig "${interface}" 0.0.0.0
- [[ -x /sbin/resolvconf ]] && resolvconf -d "${interface}"
+ [ -x /sbin/resolvconf ] && resolvconf -d "${interface}"
}
case "$1" in