From 816d566440b23b2fb7a0dcab7fa437786936df18 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Sun, 6 Jan 2008 21:56:13 +0000 Subject: [PATCH] No need for basename. --- etc.BSD/rc.devd | 4 ++-- init.d.BSD/rc-enabled | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/etc.BSD/rc.devd b/etc.BSD/rc.devd index d394415f..3073ce5e 100644 --- a/etc.BSD/rc.devd +++ b/etc.BSD/rc.devd @@ -36,8 +36,8 @@ getmedia() { } # Try and create an init script for network interfaces -if [ ! -e /etc/init.d/"$1" ]; then - base=$(basename ${1%%.*}) +if [ ! -e /etc/init.d/"$1" -a ! -e /usr/local/init.d/"$1" ]; then + base=${1%%.*} if [ "${base}" = "net" ]; then # We only create links for pyhsical interfaces [ -n "$(getmedia ${1#*.})" ] || exit 1 diff --git a/init.d.BSD/rc-enabled b/init.d.BSD/rc-enabled index 6e9da965..6a6de25a 100644 --- a/init.d.BSD/rc-enabled +++ b/init.d.BSD/rc-enabled @@ -34,7 +34,7 @@ start() { local svc= enabled= retval=0 service= for svc in $(rcorder /etc/rc.d/* /usr/local/etc/rc.d/* 2>/dev/null); do [ -x "$svc" ] || continue - service=$(basename ${svc}) + service=${svc##*/} # Skip these services for s in cleartmp moused; do @@ -46,7 +46,7 @@ start() { [ -x /usr/local/etc/init.d/"${service}" ] && continue # Ensure that the users rc.conf will start us - ignore the defaults - eval enabled=\$$(basename "${svc}")_enable + eval enabled=\$${svc##*/}_enable yesno ${enabled} || continue # Good to go!