Compare commits
3 Commits
ae4a3d3d25
...
35ce40c0ef
| Author | SHA1 | Date | |
|---|---|---|---|
| 35ce40c0ef | |||
| dd408840c4 | |||
| c3648fdae3 |
21
installJRMC
21
installJRMC
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
shopt -s extglob
|
shopt -s extglob
|
||||||
|
|
||||||
declare -g SCRIPTVERSION="1.0b8"
|
declare -g SCRIPTVERSION="1.0b9"
|
||||||
declare -g OUTPUTDIR="$PWD/output"
|
declare -g OUTPUTDIR="$PWD/output"
|
||||||
declare -g CREATEREPO_WEBROOT="/var/www/jriver"
|
declare -g CREATEREPO_WEBROOT="/var/www/jriver"
|
||||||
declare -g USER="${SUDO_USER:-$USER}"
|
declare -g USER="${SUDO_USER:-$USER}"
|
||||||
@@ -227,7 +227,7 @@ parseInput() {
|
|||||||
printHelp && exit 1
|
printHelp && exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
! debug && echo "Use --debug for verbose output"
|
(( DEBUG )) || echo "Use --debug for verbose output"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1396,7 +1396,7 @@ tests() {
|
|||||||
main() {
|
main() {
|
||||||
debug "Running: ${FUNCNAME[0]}"
|
debug "Running: ${FUNCNAME[0]}"
|
||||||
|
|
||||||
declare -g ID
|
declare -g ID MGR
|
||||||
|
|
||||||
if [[ -e "/etc/os-release" ]]; then
|
if [[ -e "/etc/os-release" ]]; then
|
||||||
source "/etc/os-release"
|
source "/etc/os-release"
|
||||||
@@ -1411,9 +1411,9 @@ main() {
|
|||||||
case "$ID" in
|
case "$ID" in
|
||||||
centos|fedora)
|
centos|fedora)
|
||||||
if hash dnf &>/dev/null; then
|
if hash dnf &>/dev/null; then
|
||||||
declare mgr="dnf"
|
MGR="dnf"
|
||||||
elif hash yum &>/dev/null; then
|
elif hash yum &>/dev/null; then
|
||||||
declare mgr="yum"
|
MGR="yum"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
debian|ubuntu|arch)
|
debian|ubuntu|arch)
|
||||||
@@ -1429,10 +1429,10 @@ main() {
|
|||||||
echo "Autodetecting distro, this may be unreliable and --compat may also be required"
|
echo "Autodetecting distro, this may be unreliable and --compat may also be required"
|
||||||
if hash dnf &>/dev/null; then
|
if hash dnf &>/dev/null; then
|
||||||
ID="fedora"
|
ID="fedora"
|
||||||
declare mgr="dnf"
|
MGR="dnf"
|
||||||
elif hash yum &>/dev/null; then
|
elif hash yum &>/dev/null; then
|
||||||
ID="centos"
|
ID="centos"
|
||||||
declare mgr="yum"
|
MGR="yum"
|
||||||
elif hash apt &>/dev/null; then
|
elif hash apt &>/dev/null; then
|
||||||
ID="ubuntu"
|
ID="ubuntu"
|
||||||
elif hash pacman &>/dev/null; then
|
elif hash pacman &>/dev/null; then
|
||||||
@@ -1445,12 +1445,11 @@ main() {
|
|||||||
|
|
||||||
# Distro-specific commands
|
# Distro-specific commands
|
||||||
if [[ "$ID" =~ ^(fedora|centos)$ ]]; then
|
if [[ "$ID" =~ ^(fedora|centos)$ ]]; then
|
||||||
pkg_install(){ sudo "$mgr" install -y "$@"; }
|
pkg_install(){ sudo "$MGR" install -y "$@"; }
|
||||||
pkg_remove(){ sudo "$mgr" remove -y "$@"; }
|
pkg_remove(){ sudo "$MGR" remove -y "$@"; }
|
||||||
pkg_update(){ sudo "$mgr" makecache; }
|
pkg_update(){ sudo "$MGR" makecache; }
|
||||||
pkg_query(){ rpm -q "$@"; }
|
pkg_query(){ rpm -q "$@"; }
|
||||||
firewall_cmd(){ sudo firewall-cmd "$@"; }
|
firewall_cmd(){ sudo firewall-cmd "$@"; }
|
||||||
unset mgr
|
|
||||||
elif [[ "$ID" =~ ^(debian|ubuntu)$ ]]; then
|
elif [[ "$ID" =~ ^(debian|ubuntu)$ ]]; then
|
||||||
pkg_install(){ sudo apt-get install -y -q0 "$@"; }
|
pkg_install(){ sudo apt-get install -y -q0 "$@"; }
|
||||||
pkg_remove(){ sudo apt-get remove --auto-remove -y -q0 "$@"; }
|
pkg_remove(){ sudo apt-get remove --auto-remove -y -q0 "$@"; }
|
||||||
|
|||||||
Reference in New Issue
Block a user