@@ -139,23 +139,23 @@ chk_term()
chk_init_sys()
{ # Return init system type name.
- if [[ $(/sbin/init --version 2>/dev/null) =~ upstart ]]; then
+ if /sbin/init --version 2>/dev/null | grep -q upstart; then
_msg "${INF}init system is: upstart"
INIT_SYS="upstart"
return 0
- elif [[ $(systemctl 2>/dev/null) =~ -\.mount ]]; then
+ elif systemctl 2>/dev/null | grep -q -- -\.mount; then
_msg "${INF}init system is: systemd"
INIT_SYS="systemd"
return 0
- elif [[ $(rc -V 2>/dev/null) =~ OpenRC ]]; then
+ elif rc -V 2>/dev/null | grep -q OpenRC; then
_msg "${INF}init system is: openrc"
INIT_SYS="openrc"
return 0
- elif [[ -f /etc/init.d/cron && ! -h /etc/init.d/cron ]]; then
+ elif [ -f /etc/init.d/cron ] && [ ! -h /etc/init.d/cron ]; then
_msg "${INF}init system is: sysv-init"
INIT_SYS="sysv-init"
return 0
- elif [[ -d /etc/sv ]]; then
+ elif [ -d /etc/sv ]; then
_msg "${INF}init system is: runit"
INIT_SYS="runit"
return 0