update-rcconf 891 B

123456789101112131415161718192021222324
  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. if [ ! -f $topdir/root_${ADK_TARGET_SYSTEM}_${ADK_TARGET_LIBC}/etc/rc.conf ];then
  8. exit 0
  9. fi
  10. for service in $(grep ^ADK_RUNTIME_START_ $topdir/.config |grep -v ADK_RUNTIME_START_SERVICES);do
  11. rcname=$(echo $service|sed -e "s#ADK_RUNTIME_START_##")
  12. rcname=$(echo $rcname| sed -e "s#=y##")
  13. rcname=$(echo $rcname| sed -e "s#^BUSYBOX_##")
  14. rcname=$(echo $rcname| tr '[:upper:]' '[:lower:]')
  15. if [ "$ADK_PKG_XBMCBOX" = "y" ];then
  16. sed -i -e "s#$rcname=\"NO\"#$rcname=\"DAEMON\"#" $rcconf
  17. else
  18. sed -i -e "s#$rcname=\"NO\"#$rcname=\"YES\"#" $rcconf
  19. fi
  20. done