...
Code Block |
---|
# detect the distribution: if [ -f /etc/redhat-release -o -f /etc/fedora-release ] ; then DISTRIBUTION="redhat" elif [ -f /etc/SuSE-release ] ; then DISTRIBUTION="suse" elif [ -f /etc/debian_version ] ; then DISTRIBUTION="debian" else echo "Error: unsupported distribution" >&2 exit 1 fi DISTRIBUTION="debian" fi # Source function library. [ "$DISTRIBUTION" = "redhat" ] && . /etc/init.d/functions [ "$DISTRIBUTION" = "suse" ] && . /etc/rc.status if [ "$DISTRIBUTION" = "suse" ] ; then echo_success() { rc_status -v } echo_failure() { rc_status -v } success() { echo_success } failure() { echo_success } elif [ "$DISTRIBUTION" = "debian" ] ; then echo_success() { echo ok } echo_failure() { echo failed } success() { echo_success } failure() { echo_success } fi |
...