From 470541d5f8ac2846337fbc0b09bde585f734e971 Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Tue, 25 Feb 2020 00:12:44 -0600 Subject: [PATCH] - Added script for detecting OS and updated xactive.sh for debug reasons --- system-config/system.sh | 66 ++++++++++++++++++++++++++++++++++++++++ system-config/xactive.sh | 10 ++++-- 2 files changed, 74 insertions(+), 2 deletions(-) create mode 100755 system-config/system.sh diff --git a/system-config/system.sh b/system-config/system.sh new file mode 100755 index 0000000..5608d2c --- /dev/null +++ b/system-config/system.sh @@ -0,0 +1,66 @@ +#!/bin/sh + +lowercase(){ + echo "$1" | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" +} + +getOS(){ + OS=$(lowercase `uname`) + kernel=`uname -r` + arch=`uname -m` + + OS=`uname` + if [ "${OS}" = "SunOS" ] ; then + OS=Solaris + arch=`uname -p` + OSSTR="${OS} ${version}(${arch} `uname -v`)" + elif [ "${OS}" = "AIX" ] ; then + OSSTR="${OS} `oslevel` (`oslevel -r`)" + elif [ "${OS}" = "Linux" ] ; then + if [ -f /etc/redhat-release ] ; then + distro=`cat /etc/redhat-release |sed s/\ release.*//` + codename=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//` + version=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//` + base='RedHat' + elif [ -f /etc/SuSE-release ] ; then + codename=`cat /etc/SuSE-release | tr "\n" ' '| sed s/VERSION.*//` + version=`cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //` + base='SuSe' + elif [ -f /etc/debian_version ] ; then + if [ -f /etc/lsb-release ] ; then + distro=`cat /etc/lsb-release | grep '^DISTRIB_ID' | awk -F= '{ print $2 }'` + codename=`cat /etc/lsb-release | grep '^DISTRIB_CODENAME' | awk -F= '{ print $2 }'` + version=`cat /etc/lsb-release | grep '^DISTRIB_RELEASE' | awk -F= '{ print $2 }'` + fi + base='Debian' + fi + if [ -f /etc/UnitedLinux-release ] ; then + distro="${distro}[`cat /etc/UnitedLinux-release | tr "\n" ' ' | sed s/VERSION.*//`]" + fi + OS=`lowercase $OS` + base=`lowercase $base` + readonly OS + readonly distro + readonly base + readonly codename + readonly version + readonly kernel + readonly arch + fi +} +getOS + +# echo "OS: $OS" +# echo "base: $base" +# echo "distro: $distro" +# echo "codename: $codename" +# echo "version: $version" +# echo "kernel: $kernel" +# echo "arch: $arch" +# echo "" + +# if [ "${distro}" = "Ubuntu" ] ; then +# echo "Apply Ubuntu Tweaks" +# fi + + diff --git a/system-config/xactive.sh b/system-config/xactive.sh index dcc1a4d..bf6de8f 100755 --- a/system-config/xactive.sh +++ b/system-config/xactive.sh @@ -1,4 +1,10 @@ #!/bin/bash -./caret_status.sh & -./kintox11 \ No newline at end of file +if [ $# -eq 0 ] + then + # No arguments + ./kintox11 +else + ./caret_status.sh & + ./kintox11 +fi