Compare commits
2 Commits
86eb9dd8b4
...
1e8b753380
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e8b753380 | |||
| 1c837f7dbb |
28
installJRMC
28
installJRMC
@@ -18,7 +18,7 @@
|
||||
|
||||
shopt -s extglob
|
||||
|
||||
declare -g SCRIPTVERSION="1.0b12"
|
||||
declare -g SCRIPTVERSION="1.0b13"
|
||||
declare -g OUTPUTDIR="$PWD/output"
|
||||
declare -g CREATEREPO_WEBROOT="/var/www/jriver"
|
||||
declare -g USER="${SUDO_USER:-$USER}"
|
||||
@@ -241,7 +241,7 @@ getVersion() {
|
||||
|
||||
declare -g MCVERSION VERSION_SOURCE MVERSION MCPKG BASE="buster" # For container method
|
||||
#declare -g BASE_NEXT="bullseye" # TODO possibly use for fallback to smooth upgrades
|
||||
declare boardurl="https://yabb.jriver.com/interact/index.php/board,71.0.html" # MC28 (Buster), for fallback webscrape
|
||||
declare boardurl="https://yabb.jriver.com/interact/index.php/board,74.0.html" # MC28 (Buster), for fallback webscrape
|
||||
|
||||
# User input
|
||||
if [[ -v MCVERSION && "$MCVERSION" =~ ([0-9]+.[0-9]+.[0-9]+) ]]; then
|
||||
@@ -263,7 +263,7 @@ getVersion() {
|
||||
VERSION_SOURCE="webscrape"
|
||||
# Hardcoded
|
||||
else
|
||||
MCVERSION="28.0.106"
|
||||
MCVERSION="29.0.18"
|
||||
VERSION_SOURCE="hardcoded version"
|
||||
err "Warning! Using hardcoded version number"
|
||||
fi
|
||||
@@ -304,7 +304,7 @@ installPackage() {
|
||||
install_flags+=(--allow-downgrades)
|
||||
;;
|
||||
--nogpgcheck)
|
||||
if [[ "$ID" =~ ^(fedora|centos|rhel)$ ]]; then
|
||||
if [[ "$ID" =~ ^(fedora|centos)$ ]]; then
|
||||
install_flags+=(--nogpgcheck)
|
||||
elif [[ "$ID" == "suse" ]]; then
|
||||
install_flags+=(--allow-unsigned-rpm)
|
||||
@@ -370,7 +370,7 @@ addRepo() {
|
||||
fi
|
||||
|
||||
echo "Adding JRiver repository to package manager"
|
||||
if [[ "$ID" =~ ^(fedora|centos|rhel)$ ]]; then
|
||||
if [[ "$ID" =~ ^(fedora|centos)$ ]]; then
|
||||
declare sources_dir="/etc/yum.repos.d/"
|
||||
sudo bash -c "cat <<- EOF > $sources_dir/jriver.repo
|
||||
[jriver]
|
||||
@@ -533,7 +533,7 @@ buildRPM() {
|
||||
|
||||
# Translate package names
|
||||
case "$TARGET" in
|
||||
fedora|centos|rhel)
|
||||
fedora|centos)
|
||||
requires=("${requires[@]/libc6/glibc}")
|
||||
requires=("${requires[@]/libasound2/alsa-lib}")
|
||||
requires=("${requires[@]/libuuid1/libuuid}")
|
||||
@@ -803,7 +803,7 @@ openFirewall() {
|
||||
fi
|
||||
|
||||
# Open the ports
|
||||
if [[ "$ID" =~ ^(fedora|centos|rhel|suse)$ ]]; then
|
||||
if [[ "$ID" =~ ^(fedora|centos|suse)$ ]]; then
|
||||
hash firewall-cmd 2>/dev/null || installPackage firewalld
|
||||
if ! firewall_cmd --get-services | grep -q "$1"; then
|
||||
firewall_cmd --permanent --new-service="$1" &>/dev/null
|
||||
@@ -1360,7 +1360,7 @@ getOS() {
|
||||
|
||||
# Set package manager for RPM distros
|
||||
case "$ID" in
|
||||
centos|fedora|rhel)
|
||||
centos|fedora)
|
||||
if hash dnf &>/dev/null; then
|
||||
MGR="dnf"
|
||||
elif hash yum &>/dev/null; then
|
||||
@@ -1488,7 +1488,7 @@ main() {
|
||||
getOS
|
||||
|
||||
# Distro-specific commands
|
||||
if [[ "$ID" =~ ^(fedora|centos|rhel)$ ]]; then
|
||||
if [[ "$ID" =~ ^(fedora|centos)$ ]]; then
|
||||
pkg_install(){ sudo "$MGR" install -y "$@"; }
|
||||
pkg_remove(){ sudo "$MGR" remove -y "$@"; }
|
||||
pkg_update(){ sudo "$MGR" makecache; }
|
||||
@@ -1519,7 +1519,7 @@ main() {
|
||||
getVersion
|
||||
|
||||
# Set target package name
|
||||
if [[ "$ID" =~ ^(fedora|centos|rhel|suse)$ ]]; then
|
||||
if [[ "$ID" =~ ^(fedora|centos|suse)$ ]]; then
|
||||
MCPKG="MediaCenter"
|
||||
[[ "$VERSION_SOURCE" == "user input" ]] && MCPKG="$MCPKG-$MCVERSION"
|
||||
elif [[ "$ID" =~ ^(debian|ubuntu)$ ]]; then
|
||||
@@ -1540,11 +1540,9 @@ main() {
|
||||
echo "Adding universe repository"
|
||||
sudo add-apt-repository universe
|
||||
fi
|
||||
elif [[ "$ID" =~ ^(centos|rhel)$ ]]; then
|
||||
elif [[ "$ID" =~ ^(centos)$ ]] && ! hash dpkg &>/dev/null; then
|
||||
echo "Adding EPEL repository"
|
||||
installPackage epel-release
|
||||
elif [[ "$ID" =~ ^(rhel)$ ]] && ! hash dpkg &>/dev/null; then
|
||||
installPackage epel-release
|
||||
fi
|
||||
|
||||
if (( REPO_INSTALL_SWITCH )); then
|
||||
@@ -1562,7 +1560,7 @@ main() {
|
||||
if (( BUILD_SWITCH )); then
|
||||
installPackage "wget"
|
||||
acquireDeb
|
||||
if [[ "$TARGET" =~ (centos|fedora|rhel|suse) ]]; then
|
||||
if [[ "$TARGET" =~ (centos|fedora|suse) ]]; then
|
||||
installPackage "dpkg" "rpm-build"
|
||||
buildRPM
|
||||
fi
|
||||
@@ -1570,7 +1568,7 @@ main() {
|
||||
|
||||
if (( LOCAL_INSTALL_SWITCH )); then
|
||||
if ([[ "$TARGET" =~ (debian|ubuntu) ]] && installMCDEB) ||
|
||||
([[ "$TARGET" =~ (fedora|centos|rhel|suse) ]] &&
|
||||
([[ "$TARGET" =~ (fedora|centos|suse) ]] &&
|
||||
installPackage --skip-check-installed --nogpgcheck "$MCRPM") ||
|
||||
([[ "$TARGET" == "arch" ]] && installMCArch); then
|
||||
echo "JRiver Media Center installed successfully from local package"
|
||||
|
||||
Reference in New Issue
Block a user