From 9acc234c6d6a48dd188d86d4b1ad74199225a797 Mon Sep 17 00:00:00 2001 From: mafoo Date: Tue, 5 Jul 2016 10:40:05 +0100 Subject: [PATCH] Enhance-Add --diag --- debian/install.sh | 1 + install.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/debian/install.sh b/debian/install.sh index c22757f..2125457 100755 --- a/debian/install.sh +++ b/debian/install.sh @@ -13,6 +13,7 @@ if [ $? -ne 0 ]; then exit 1 fi +#DO NOT EDIT THESE LINES use --help to get the current list of options export USE_SWITCH_SOURCE=false export USE_SWITCH_PACKAGE_ALL=false export USE_SWITCH_PACKAGE_UNOFFICIAL_ARM=false diff --git a/install.sh b/install.sh index 51cdf81..e15c0f1 100644 --- a/install.sh +++ b/install.sh @@ -3,6 +3,8 @@ # 1 general error # 2 unsupported OS # 3 unsupported CPU/OS bits +# note all command line options are passed onto the relevant installer +# except --diag which will cause this script to output the diag info and exit verbose () { echo "${green}$1${normal}" @@ -43,6 +45,33 @@ fi #Make ourselves executable next time we are run chmod +x $0 +#Check if the user has requested diag +ARGS=$(getopt -n 'install.sh' -o h -l diag -- "$@") +DIAG=false +while true; do + case "$1" in + --diag ) export DIAG=true; shift ;; + -- ) shift; break ;; + * ) break ;; + esac +done +if [ $DIAG = true ]; then + verbose "Diagnostic information:-"; + echo "=> lsb_release -a <=" + lsb_release -a + echo + echo "=> cat/proc/cpu <=" + cat /proc/cpu + echo + echo + echo "=> uname -a <=" + uname -a + echo + verbose "For IRC please place this information in http://pastebin.com" + verbose "For Github Issues/PRs please paste inside a code segment (`example`)" + exit +fi + #Os/Distro Check os_check=$(lsb_release -is) check_major_release=$(lsb_release -rs | cut -d. -f1)