aboutsummaryrefslogtreecommitdiff
path: root/arch-daemons
diff options
context:
space:
mode:
Diffstat (limited to 'arch-daemons')
-rwxr-xr-xarch-daemons9
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 \