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
declare -g SCRIPTVERSION="1.0b10"
declare -g SCRIPTVERSION="1.0b12"
declare -g OUTPUTDIR="$PWD/output"
declare -g CREATEREPO_WEBROOT="/var/www/jriver"
declare -g USER="${SUDO_USER:-$USER}"
@@ -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]
@@ -386,7 +386,8 @@ addRepo() {
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
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
sudo zypper addrepo --no-gpgcheck "https://repos.bryanroessler.com/jriver" jriver &>/dev/null
elif [[ "$ID" == "arch" ]]; then
@@ -532,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}")
@@ -802,8 +803,8 @@ openFirewall() {
fi
# Open the ports
if [[ "$ID" =~ ^(fedora|centos|rhel|suse)$ ]]; then
installPackage firewalld
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
firewall_cmd --permanent --service="$1" --set-description="$1 installed by installJRMC" &>/dev/null
@@ -816,7 +817,7 @@ openFirewall() {
fi
elif [[ "$ID" =~ ^(debian|ubuntu)$ ]]; then
# 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
sudo bash -c "cat <<- EOF > /etc/ufw/applications.d/$1
[$1]
@@ -1359,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
@@ -1487,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; }
@@ -1518,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
@@ -1539,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
@@ -1561,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
@@ -1569,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"