update-rcconf 795 B

1234567891011121314151617181920
  1. #!/usr/bin/env bash
  2. # This file is part of the OpenADK project. OpenADK is copyrighted
  3. # material, please see the LICENCE file in the top-level directory.
  4. topdir=$(readlink -nf $(dirname $0)/.. 2>/dev/null || (cd $(dirname $0)/..; pwd -P))
  5. . $topdir/.config
  6. rcconf=$topdir/root_${ADK_TARGET_SYSTEM}_${ADK_TARGET_LIBC}/etc/rc.conf
  7. for service in $(grep ^ADK_RUNTIME_START_ $topdir/.config |grep -v ADK_RUNTIME_START_SERVICES);do
  8. rcname=$(echo $service|sed -e "s#ADK_RUNTIME_START_##")
  9. rcname=$(echo $rcname| sed -e "s#=y##")
  10. rcname=$(echo $rcname| sed -e "s#^BUSYBOX_##")
  11. rcname=$(echo $rcname| tr '[:upper:]' '[:lower:]')
  12. if [ $ADK_PKG_XBMCBOX = "y" ];then
  13. sed -i -e "s#$rcname=\"NO\"#$rcname=\"DAEMON\"#" $rcconf
  14. else
  15. sed -i -e "s#$rcname=\"NO\"#$rcname=\"YES\"#" $rcconf
  16. fi
  17. done