diff options
author | Tom Gundersen <teg@jklm.no> | 2012-07-28 02:54:42 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2012-07-28 02:54:42 +0200 |
commit | f670511763a05ac5ef688d335187ac1ccabf0487 (patch) | |
tree | d89832dfb7d0022225d8887d3a5a78bf7ed3cab8 | |
parent | b0b1d8fb0f933b37e5878541e18034614eed47fb (diff) |
arch-daemons: add some sanity checking
Don't create wrapper services, for things that are not exectuable files.
Signed-off-by: Tom Gundersen <teg@jklm.no>
-rwxr-xr-x | arch-daemons | 9 |
1 files changed, 9 insertions, 0 deletions
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 \ |