From 6140837f0d0b7dfb05209bc4d92696ede62abffe Mon Sep 17 00:00:00 2001 From: Henri Schumacher Date: Fri, 5 Dec 2014 01:20:19 +0100 Subject: [PATCH 1/2] More specific detecting of Ubuntu OS. Closes #246. --- bin/v-list-sys-info | 2 +- install/vst-install-debian.sh | 2 +- install/vst-install.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/v-list-sys-info b/bin/v-list-sys-info index 4a32679d..c9f9ec0d 100755 --- a/bin/v-list-sys-info +++ b/bin/v-list-sys-info @@ -32,7 +32,7 @@ if [ -e '/etc/redhat-release' ]; then fi VERSION=$(cat /etc/redhat-release | tr ' ' '\n' |grep [0-9]) else - if [ -e '/etc/lsb-release' ] && [ -e '/etc/debian_version' ]; then + if [ "$(lsb_release -si)" == "Ubuntu" ] && [ -e '/etc/debian_version' ]; then OS="Ubuntu" VERSION=$(grep DISTRIB_RELEASE /etc/lsb-release| cut -f 2 -d '=') else diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh index ea6bf7d0..a188c065 100644 --- a/install/vst-install-debian.sh +++ b/install/vst-install-debian.sh @@ -95,7 +95,7 @@ if [ "x$(id -u)" != 'x0' ]; then fi # Check supported version -if [ -e '/etc/redhat-release' ] || [ -e '/etc/lsb-release' ]; then +if [ -e '/etc/redhat-release' ] || [ "$(lsb_release -si)" == "Ubuntu" ]; then echo 'Error: sorry, this installer works only on Debian 7' exit 1 fi diff --git a/install/vst-install.sh b/install/vst-install.sh index b3c3f50a..8d07cce2 100644 --- a/install/vst-install.sh +++ b/install/vst-install.sh @@ -42,7 +42,7 @@ if [ -e '/etc/redhat-release' ]; then type="rhel" fi -if [ -e '/etc/lsb-release' ] && [ -e '/etc/debian_version' ]; then +if [ "$(lsb_release -si)" == "Ubuntu" ] && [ -e '/etc/debian_version' ]; then type="ubuntu" fi From cd19187fc5d6f51f07c146f69a5191f302deab99 Mon Sep 17 00:00:00 2001 From: Henri Schumacher Date: Fri, 5 Dec 2014 01:44:03 +0100 Subject: [PATCH 2/2] Adds systemd compatible service status check. Closes #247. --- bin/v-list-sys-services | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/v-list-sys-services b/bin/v-list-sys-services index ee1aa1ab..22157799 100755 --- a/bin/v-list-sys-services +++ b/bin/v-list-sys-services @@ -23,9 +23,16 @@ get_srv_state() { proc_name=${2-$1} # Check service status - status=$(service $srv status 2>/dev/null) - rc=$? - stopped=$(echo $status| grep stop) + + # Check if systemd is used as init system + if [[ $(systemctl) =~ -\.mount ]]; then + $(systemctl -q is-active $srv) + rc=$? + else + status=$(service $srv status 2>/dev/null) + rc=$? + stopped=$(echo $status| grep stop) + fi if [ "$rc" -eq 0 ] && [ -z "$stopped" ]; then state='running'