From f670511763a05ac5ef688d335187ac1ccabf0487 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Sat, 28 Jul 2012 02:54:42 +0200 Subject: arch-daemons: add some sanity checking Don't create wrapper services, for things that are not exectuable files. Signed-off-by: Tom Gundersen --- arch-daemons | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch-daemons b/arch-daemons index 34f4597..ffe4289 100755 --- a/arch-daemons +++ b/arch-daemons @@ -13,10 +13,19 @@ dest=$3 # list of services that have to be started before the next one deps=() +# Check if $1 is a valid daemon name +have_daemon() { + [[ -f /etc/rc.d/$1 && -x /etc/rc.d/$1 ]] +} + # Make service file create_unit() { local deps= daemon=${1%.service} + if ! have_daemon $daemon; then + return + fi + (( $# > 1 )) && printf -v deps 'After=%s\n' "${*:2}" printf \ -- cgit v1.2.3