From 4241a044636aa60d3b0501a0ad00d29e2c2e7965 Mon Sep 17 00:00:00 2001 From: bryan Date: Wed, 15 Apr 2020 18:30:44 -0400 Subject: [PATCH] Add a ton of debugging --- installJRMC | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/installJRMC b/installJRMC index 13243eb..d09ed2e 100755 --- a/installJRMC +++ b/installJRMC @@ -40,6 +40,8 @@ installJRMC () { _printHelpAndExit () { + _runDebug "${FUNCNAME[0]}" + cat <<-'EOF' USAGE: installJRMC [[OPTION] [VALUE]]... @@ -103,6 +105,8 @@ EOF _parseInput () { + _runDebug "${FUNCNAME[0]}" + if _input=$(getopt -o +vdhu -l rpmbuild,outputdir:,mcversion:,restorefile:,betapass:,service:,version,debug,help,uninstall,createrepo,createrepo-webroot:,createrepo-user:,vncpass:,display: -- "$@"); then eval set -- "$_input" while true; do @@ -168,8 +172,16 @@ EOF } + _runDebug () { + + [[ -n $_debug ]] && echo "Running: " "$@" + } + + _checkUser () { + _runDebug "${FUNCNAME[0]}" + if [[ "$_user" == "root" ]]; then cat < $_service_fname @@ -728,6 +780,8 @@ EOF" _serviceX11VNC () { + _runDebug "${FUNCNAME[0]}" + _installPackage x11vnc _setVNCPass @@ -761,6 +815,8 @@ EOF" _serviceCreaterepo () { + _runDebug "${FUNCNAME[0]}" + _generateServiceVars "jriver-createrepo" "${_bash_cmd[@]}" "cat <<-EOF > $_service_fname @@ -791,6 +847,8 @@ EOF" _uninstall () { + _runDebug "${FUNCNAME[0]}" + read -r -p "Do you really want to uninstall all JRiver Media Center files? [y/N] " _response _response=${_response,,} # tolower [[ ! "$_response" =~ ^(yes|y)$ ]] && echo "Cancelling uninstall..." && exit 0