diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-07-23 18:24:11 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-07-23 18:24:11 +0000 |
commit | 2d2ddf507bf1ae2f4cc595b23b8e018398cbe8dd (patch) | |
tree | a63d3b3b1c89018b5419358eed5c2bb0acf1cd92 /main/openrc/openrc.post-install | |
parent | e374901731eb35599bd6735de4dd38560e3a79b8 (diff) | |
download | aports-2d2ddf507bf1ae2f4cc595b23b8e018398cbe8dd.tar.bz2 aports-2d2ddf507bf1ae2f4cc595b23b8e018398cbe8dd.tar.xz |
move core/* to main/
added maintainer to several packages as well
Diffstat (limited to 'main/openrc/openrc.post-install')
-rw-r--r-- | main/openrc/openrc.post-install | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/main/openrc/openrc.post-install b/main/openrc/openrc.post-install new file mode 100644 index 000000000..1d0201d3a --- /dev/null +++ b/main/openrc/openrc.post-install @@ -0,0 +1,35 @@ +#!/bin/sh + +rc_update() { + local svc="$1" + local level="$2" + mkdir -p /etc/runlevels/$level + ln -sf /etc/init.d/$svc /etc/runlevels/$level +} + +if [ ! -d etc/rcS.d ] && [ ! -d etc/rcL.d ]; then + exit 0 +fi + +for i in etc/rc[SL].d/*; do + [ -L "$i" ] || continue + oldsvc=${i##*/S[0-9][0-9]} + # some services are renamed + case "$oldsvc" in + modutils) svc=modules;; + procps) svc=sysctl;; + bootmisc.sh) svc=bootmisc;; + keymap) svc=keymaps;; + *) svc=$oldsvc;; + esac + + # add the service to correct "runlevel" + case "$svc" in + hwclock|modules|sysctl|hostname|keymaps|syslog|bootmisc) + rc_update $svc boot;; + *) rc_update $svc default;; + esac + + rm $i +done + |