[__start_on_boot] Merge alpine and gentoo, update gentoo

This commit is contained in:
Nico Schottelius 2019-04-15 17:02:09 +02:00
parent dbf29c18c1
commit ec935353d7
3 changed files with 11 additions and 15 deletions

View file

@ -75,9 +75,14 @@ else
state=$(chkconfig --check "$name" "$runlevel" || echo absent) state=$(chkconfig --check "$name" "$runlevel" || echo absent)
[ "$state" ] || state="present" [ "$state" ] || state="present"
;; ;;
gentoo) gentoo|alpine)
state="absent"
for d in /etc/runlevels/*; do
if [ -f "/etc/runlevels/${d}/${name}" ];then
state="present" state="present"
[ -f "/etc/runlevels/${target_runlevel}/${name}" ] || state="absent" break
fi
done
;; ;;
freebsd) freebsd)
state="absent" state="absent"
@ -88,10 +93,6 @@ else
# OpenBSD 5.7 and higher # OpenBSD 5.7 and higher
rcctl ls on | grep "^${name}$" && state='present' rcctl ls on | grep "^${name}$" && state='present'
;; ;;
alpine)
state="$(rc-update show | sed 's/ *//' | grep -q "^${name} |" && echo present)"
[ "$state" ] || state="absent"
;;
*) *)
echo "Unsupported os: $os" >&2 echo "Unsupported os: $os" >&2

View file

@ -40,9 +40,6 @@ case "$state_should" in
echo "systemctl -q enable '$name'" echo "systemctl -q enable '$name'"
else else
case "$os" in case "$os" in
alpine)
echo "rc-update -q add '${name}'"
;;
debian) debian)
case "$os_version" in case "$os_version" in
[1-7]*) [1-7]*)
@ -61,7 +58,7 @@ case "$state_should" in
echo "update-rc.d '$name' defaults >/dev/null" echo "update-rc.d '$name' defaults >/dev/null"
;; ;;
gentoo) alpine|gentoo)
echo "rc-update add '$name' '$target_runlevel'" echo "rc-update add '$name' '$target_runlevel'"
;; ;;
@ -105,14 +102,11 @@ case "$state_should" in
else else
case "$os" in case "$os" in
alpine)
echo "rc-update -q del '${name}'"
;;
debian|ubuntu|devuan) debian|ubuntu|devuan)
echo "update-rc.d -f '$name' remove" echo "update-rc.d -f '$name' remove"
;; ;;
gentoo) alpine|gentoo)
echo "rc-update del '$name' '$target_runlevel'" echo "rc-update del '$name' '$target_runlevel'"
;; ;;

View file

@ -3,6 +3,7 @@ Changelog
next: next:
* Type __package: Add __package_apk support (Nico Schottelius) * Type __package: Add __package_apk support (Nico Schottelius)
* Type __start_on_boot: Add alpine support (Nico Schottelius)
* New type: __package_apk (Nico Schottelius) * New type: __package_apk (Nico Schottelius)
4.10.11: 2019-04-13 4.10.11: 2019-04-13