lesteff 9 лет назад
Родитель
Сommit
00bc4947e2
1 измененных файлов с 11 добавлено и 2 удалено
  1. 11 2
      check_service.sh

+ 11 - 2
check_service.sh

@@ -50,11 +50,20 @@ fi
 
 os_check() {
 if [ "$OS" == null ]; then
-echo "Use \`\`-o'' and specify the OS as an argument"
-exit 3
+        if [[ `uname` == 'Linux' ]]; then
+                OS='linux'
+        #I dont know the propper OS String for osx etc... as example
+        #elif [[ "$unamestr" == 'FreeBSD' ]]; then
+        #       OS='freebsd'
+        else
+                echo "OS not recognized, Use \`\`-o'' and specify the OS as an argument"
+                exit 3
+        fi
 fi
 }
 
+
+
 determine_service_tool() {
 if [[ $OS == linux ]]; then
         if command -v systemctl >/dev/null 2>&1; then