blob: 2617253865245d82d179618c8cd82786e89b9f42 (
plain) (
tree)
|
|
#!/bin/bash
[ x$INITPATH = x ] && for i in `tr : ' ' <<<$MORE_INITPATH` `tr : ' ' <<<$XDG_CONFIG_DIRS` ~/.config ~ /etc
do
[ -d $i/init.d ] && INITPATH=$INITPATH:$i/init.d
done
if [ x$1 = xlist ]
then
for i in `tr : ' ' <<<$INITPATH`
do
if [ -w $i ]
then
ls $i
else
for j in $i/*
do
[ ! -x $j ] && continue
head -n1 $j | grep "#!.*openrc-run" > /dev/null 2> /dev/null && continue
echo `rev <<<$j | cut -f/ -d1 | rev`
done
fi
done
exit 1
fi
[ x$1 = x ] && { echo -e "Uporaba:\n\t$0 list\n\t$0 <storitev> <dejanje>"; exit 1; }
for i in `tr : ' ' <<<$INITPATH`
do
[ -x $i/$1 ] && exec $i/$@
done
|