5 Commits

Author SHA1 Message Date
1c837f7dbb Roll RHEL into CentOS 2022-03-09 09:56:21 -05:00
86eb9dd8b4 Check for firewall 2022-03-09 09:42:57 -05:00
400ec7c03d Increment version 2022-02-27 12:29:16 -05:00
ace271b0ff Merge branch 'dev' 2022-02-27 12:28:12 -05:00
bf0587a1a5 Update version number 2022-02-18 18:52:38 -05:00

View File

@@ -18,7 +18,7 @@
shopt -s extglob shopt -s extglob
declare -g SCRIPTVERSION="1.0b10" declare -g SCRIPTVERSION="1.0b12"
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}"
@@ -304,7 +304,7 @@ installPackage() {
install_flags+=(--allow-downgrades) install_flags+=(--allow-downgrades)
;; ;;
--nogpgcheck) --nogpgcheck)
if [[ "$ID" =~ ^(fedora|centos|rhel)$ ]]; then if [[ "$ID" =~ ^(fedora|centos)$ ]]; then
install_flags+=(--nogpgcheck) install_flags+=(--nogpgcheck)
elif [[ "$ID" == "suse" ]]; then elif [[ "$ID" == "suse" ]]; then
install_flags+=(--allow-unsigned-rpm) install_flags+=(--allow-unsigned-rpm)
@@ -370,7 +370,7 @@ addRepo() {
fi fi
echo "Adding JRiver repository to package manager" 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/" declare sources_dir="/etc/yum.repos.d/"
sudo bash -c "cat <<- EOF > $sources_dir/jriver.repo sudo bash -c "cat <<- EOF > $sources_dir/jriver.repo
[jriver] [jriver]
@@ -386,7 +386,8 @@ addRepo() {
sudo bash -c "cat <<- EOF > $sources_dir/jriver.list sudo bash -c "cat <<- EOF > $sources_dir/jriver.list
deb [trusted=yes arch=amd64,i386,armhf,arm64] http://dist.jriver.com/latest/mediacenter/ $BASE main deb [trusted=yes arch=amd64,i386,armhf,arm64] http://dist.jriver.com/latest/mediacenter/ $BASE main
EOF" EOF"
wget -q "http://dist.jriver.com/mediacenter@jriver.com.gpg.key" -O- | sudo apt-key add - &>/dev/null #wget -q "http://dist.jriver.com/mediacenter@jriver.com.gpg.key" -O- | sudo apt-key add - &>/dev/null
wget -qO- "http://dist.jriver.com/mediacenter@jriver.com.gpg.key" | sudo tee /etc/apt/trusted.gpg.d/jriver.asc
elif [[ "$ID" == "suse" ]]; then elif [[ "$ID" == "suse" ]]; then
sudo zypper addrepo --no-gpgcheck "https://repos.bryanroessler.com/jriver" jriver &>/dev/null sudo zypper addrepo --no-gpgcheck "https://repos.bryanroessler.com/jriver" jriver &>/dev/null
elif [[ "$ID" == "arch" ]]; then elif [[ "$ID" == "arch" ]]; then
@@ -532,7 +533,7 @@ buildRPM() {
# Translate package names # Translate package names
case "$TARGET" in case "$TARGET" in
fedora|centos|rhel) fedora|centos)
requires=("${requires[@]/libc6/glibc}") requires=("${requires[@]/libc6/glibc}")
requires=("${requires[@]/libasound2/alsa-lib}") requires=("${requires[@]/libasound2/alsa-lib}")
requires=("${requires[@]/libuuid1/libuuid}") requires=("${requires[@]/libuuid1/libuuid}")
@@ -802,8 +803,8 @@ openFirewall() {
fi fi
# Open the ports # Open the ports
if [[ "$ID" =~ ^(fedora|centos|rhel|suse)$ ]]; then if [[ "$ID" =~ ^(fedora|centos|suse)$ ]]; then
installPackage firewalld hash firewall-cmd 2>/dev/null || installPackage firewalld
if ! firewall_cmd --get-services | grep -q "$1"; then if ! firewall_cmd --get-services | grep -q "$1"; then
firewall_cmd --permanent --new-service="$1" &>/dev/null firewall_cmd --permanent --new-service="$1" &>/dev/null
firewall_cmd --permanent --service="$1" --set-description="$1 installed by installJRMC" &>/dev/null firewall_cmd --permanent --service="$1" --set-description="$1 installed by installJRMC" &>/dev/null
@@ -816,7 +817,7 @@ openFirewall() {
fi fi
elif [[ "$ID" =~ ^(debian|ubuntu)$ ]]; then elif [[ "$ID" =~ ^(debian|ubuntu)$ ]]; then
# Debian ufw package state is broken on fresh installations # Debian ufw package state is broken on fresh installations
installPackage ufw hash ufw 2>/dev/null || installPackage ufw
if [[ ! -f "/etc/ufw/applications.d/$1" ]]; then if [[ ! -f "/etc/ufw/applications.d/$1" ]]; then
sudo bash -c "cat <<- EOF > /etc/ufw/applications.d/$1 sudo bash -c "cat <<- EOF > /etc/ufw/applications.d/$1
[$1] [$1]
@@ -1359,7 +1360,7 @@ getOS() {
# Set package manager for RPM distros # Set package manager for RPM distros
case "$ID" in case "$ID" in
centos|fedora|rhel) centos|fedora)
if hash dnf &>/dev/null; then if hash dnf &>/dev/null; then
MGR="dnf" MGR="dnf"
elif hash yum &>/dev/null; then elif hash yum &>/dev/null; then
@@ -1487,7 +1488,7 @@ main() {
getOS getOS
# Distro-specific commands # Distro-specific commands
if [[ "$ID" =~ ^(fedora|centos|rhel)$ ]]; 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; }
@@ -1518,7 +1519,7 @@ main() {
getVersion getVersion
# Set target package name # Set target package name
if [[ "$ID" =~ ^(fedora|centos|rhel|suse)$ ]]; then if [[ "$ID" =~ ^(fedora|centos|suse)$ ]]; then
MCPKG="MediaCenter" MCPKG="MediaCenter"
[[ "$VERSION_SOURCE" == "user input" ]] && MCPKG="$MCPKG-$MCVERSION" [[ "$VERSION_SOURCE" == "user input" ]] && MCPKG="$MCPKG-$MCVERSION"
elif [[ "$ID" =~ ^(debian|ubuntu)$ ]]; then elif [[ "$ID" =~ ^(debian|ubuntu)$ ]]; then
@@ -1539,11 +1540,9 @@ main() {
echo "Adding universe repository" echo "Adding universe repository"
sudo add-apt-repository universe sudo add-apt-repository universe
fi fi
elif [[ "$ID" =~ ^(centos|rhel)$ ]]; then elif [[ "$ID" =~ ^(centos)$ ]] && ! hash dpkg &>/dev/null; then
echo "Adding EPEL repository" echo "Adding EPEL repository"
installPackage epel-release installPackage epel-release
elif [[ "$ID" =~ ^(rhel)$ ]] && ! hash dpkg &>/dev/null; then
installPackage epel-release
fi fi
if (( REPO_INSTALL_SWITCH )); then if (( REPO_INSTALL_SWITCH )); then
@@ -1561,7 +1560,7 @@ main() {
if (( BUILD_SWITCH )); then if (( BUILD_SWITCH )); then
installPackage "wget" installPackage "wget"
acquireDeb acquireDeb
if [[ "$TARGET" =~ (centos|fedora|rhel|suse) ]]; then if [[ "$TARGET" =~ (centos|fedora|suse) ]]; then
installPackage "dpkg" "rpm-build" installPackage "dpkg" "rpm-build"
buildRPM buildRPM
fi fi
@@ -1569,7 +1568,7 @@ main() {
if (( LOCAL_INSTALL_SWITCH )); then if (( LOCAL_INSTALL_SWITCH )); then
if ([[ "$TARGET" =~ (debian|ubuntu) ]] && installMCDEB) || if ([[ "$TARGET" =~ (debian|ubuntu) ]] && installMCDEB) ||
([[ "$TARGET" =~ (fedora|centos|rhel|suse) ]] && ([[ "$TARGET" =~ (fedora|centos|suse) ]] &&
installPackage --skip-check-installed --nogpgcheck "$MCRPM") || installPackage --skip-check-installed --nogpgcheck "$MCRPM") ||
([[ "$TARGET" == "arch" ]] && installMCArch); then ([[ "$TARGET" == "arch" ]] && installMCArch); then
echo "JRiver Media Center installed successfully from local package" echo "JRiver Media Center installed successfully from local package"