From 178253be0ada30420f39720e7e0fa4ee4058bce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Sat, 1 Jun 2024 23:00:49 +0200 Subject: razne stvari iz b --- skripti/service.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 skripti/service.sh (limited to 'skripti/service.sh') diff --git a/skripti/service.sh b/skripti/service.sh new file mode 100755 index 0000000..2617253 --- /dev/null +++ b/skripti/service.sh @@ -0,0 +1,28 @@ +#!/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 "; exit 1; } +for i in `tr : ' ' <<<$INITPATH` +do + [ -x $i/$1 ] && exec $i/$@ +done -- cgit v1.2.3