1 コミット

作成者 SHA1 メッセージ 日付
ed501ee69b Major refactor, bump version to 0.2 2020-04-24 13:05:33 -04:00

ファイルの表示

@@ -55,7 +55,7 @@ OPTIONS
--betapass PASSWORD
Enter beta team password for access to beta builds
--service, -s SERVICE
See SERVICES section below for a list of possible services to install
See SERVICES section below for a list of possible service to install
--createrepo
Build rpm, copy to webroot, and run createrepo
--createrepo-webroot PATH
@@ -71,7 +71,8 @@ OPTIONS
--help, -h
Print help dialog and exit
--uninstall, -u
Uninstall JRiver MC, cleanup service files, and remove firewall rules (does not remove library files)
Uninstall JRiver MC, cleanup service files, and remove firewall rules (does not remove
library files)
SERVICES
@@ -178,7 +179,7 @@ EOF
shift
done
else
err "Incorrect options provided"
echo "Incorrect options provided"
_printHelpAndExit 1
fi
}
@@ -190,9 +191,6 @@ EOF
}
#######################################
# Call this at the beginning of every function in order to track
#######################################
_runDebug() {
[[ -n $_debug ]] && echo "Running: " "$@"
@@ -201,6 +199,8 @@ EOF
#######################################
# Prepend this to any command that you wish to execute with sudo (i.e. when _user is NOT root)
# Arguments:
# Takes one optional argument
#######################################
_ifSudo() {
@@ -362,9 +362,6 @@ EOF
fi
done
[[ -n $_debug ]] && echo "_pkg_array:" "${_pkg_array[@]}"
[[ -n $_debug ]] && echo "_url_pkg_array:" "${_url_pkg_array[@]}"
# Install from package name (with gpg check)
if [[ ${#_pkg_array[@]} -ge 1 ]]; then
echo "Installing: " "${_pkg_array[@]}"
@@ -453,17 +450,13 @@ EOF
_installPackage wget
# Get latest version from Interact
echo "Scraping latest MC version number from Interact..."
echo -n "Scraping latest MC version number from Interact..."
if ! _mcversion=$(wget -qO- "$_boardurl" | grep -o "[0-9][0-9]\.[0-9]\.[0-9]\+" | head -n 1); then
err "MC version could not be scraped. Please specify a version manually using --mcversion or check your --boardurl"
_printHelpAndExit 1
else
echo "$_mcversion"
fi
fi
echo "Using version: $_mcversion"
# Extract major version number
_mversion="${_mcversion%%.*}"
@@ -498,8 +491,8 @@ EOF
#######################################
# Clean up nonsensical user input
# Notes:
# I try to keep this function as short as possible and provide better input options and
# sensible defaults than workarounds
# I try to keep this function as short as possible and jusitfy each decision in the comments
# I prefer to provide better input options and sensible defaults than workarounds
# Test:
# _installJRMC should run sucessfully even without running _sanityChecks()
#######################################
@@ -518,23 +511,8 @@ EOF
done
}
_checkMCInstalled() {
if [[ "${_services[*]}" =~ ^(mediacenter|mediaserver)$ ]]; then
if [[ -z $_repoinstall && -z $_rpminstall ]]; then
if [[ -x $(command -v "mediacenter$_mversion") ]]; then
err "You are attempting to install a service that relies on mediacenter$_mversion but --repo-install/--rpmbuild-install are not set and mediacenter$_mversion is not present"
_printHelpAndExit 1
fi
fi
fi
}
# Disable sanity checks for now to simplify debugging
_checkServices
_checkMCInstalled
#_checkServices
}