summaryrefslogtreecommitdiff
path: root/scripts/update-rcconf
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2014-06-27 18:17:51 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2014-06-27 18:18:07 +0200
commit120fa5a3bfee8bdbdf2441cdd1b5aff0e4513db4 (patch)
tree580cd6c1f4c3c8a392b4473581844f5a5dc768c5 /scripts/update-rcconf
parente31aa3edfc7f6508e73b30d76bb1c82a4b5e8b2d (diff)
rework service startup, do not hardcode into postinst scripts
Diffstat (limited to 'scripts/update-rcconf')
-rwxr-xr-xscripts/update-rcconf20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/update-rcconf b/scripts/update-rcconf
new file mode 100755
index 000000000..bc896d3d1
--- /dev/null
+++ b/scripts/update-rcconf
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+topdir=$(readlink -nf $(dirname $0)/.. 2>/dev/null || (cd $(dirname $0)/..; pwd -P))
+. $topdir/.config
+
+rcconf=$topdir/root_${ADK_TARGET_SYSTEM}_${ADK_TARGET_LIBC}/etc/rc.conf
+
+for service in $(grep ^ADK_RUNTIME_START_ $topdir/.config |grep -v ADK_RUNTIME_START_SERVICES);do
+ rcname=$(echo $service|sed -e "s#ADK_RUNTIME_START_##")
+ rcname=$(echo $rcname| sed -e "s#=y##")
+ rcname=$(echo $rcname| sed -e "s#^BUSYBOX_##")
+ rcname=$(echo $rcname| tr '[:upper:]' '[:lower:]')
+ if [ $ADK_PKG_XBMCBOX = "y" ];then
+ sed -i -e "s#$rcname=\"NO\"#$rcname=\"DAEMON\"#" $rcconf
+ else
+ sed -i -e "s#$rcname=\"NO\"#$rcname=\"YES\"#" $rcconf
+ fi
+done