# old version (without -$pkgrel): ${1%%-*}
# new version (without -$pkgrel): ${2%%-*}

PKGNAME="init-system-helpers"

# arg 1:  the new package version
pre_install() {
    true
}

# arg 1:  the new package version
post_install() {
    post_upgrade $@
}

# arg 1:  the new package version
# arg 2:  the old package version
pre_upgrade() {
    true
}

# arg 1:  the new package version
# arg 2:  the old package version
post_upgrade() {
    [[ -e /etc/rc.d/init.d ]] || install -dm0755 /etc/rc.d/init.d
    [[ -e /etc/init.d ]] || ln -s rc.d/init.d /etc/init.d 2>/dev/null
    for n in 0 1 2 3 4 5 6 S; do
    	install -dm0755 /etc/rc.d/rc${n}.d
	[[ -e /etc/rc${n}.d ]] || ln -s rc.d/rc${n}.d /etc/rc${n}.d 2>/dev/null
    done
}

# arg 1:  the old package version
pre_remove() {
    true
}

# arg 1:  the old package version
post_remove() {
    true
}
