summaryrefslogtreecommitdiff
path: root/scripts/update-rcconf
blob: bc896d3d182879e51a2736db3d5abbb63c5b2cfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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