No need for basename.

This commit is contained in:
Roy Marples 2008-01-06 21:56:13 +00:00
parent 956a867a71
commit 816d566440
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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!