Compare commits
11 Commits
3aa6fe8028
...
60603c087d
| Author | SHA1 | Date | |
|---|---|---|---|
| 60603c087d | |||
| dc15e79942 | |||
| 239668490e | |||
| fcd270c916 | |||
| 0d7c2d0949 | |||
| 024581fd55 | |||
| d961b4027f | |||
| f54273a745 | |||
| 952560310a | |||
| 9dd5c94c6f | |||
| 5b35399e1c |
13
.gitignore
vendored
13
.gitignore
vendored
@@ -1,10 +1,3 @@
|
|||||||
**/
|
.old/
|
||||||
*.zip
|
.vscode/
|
||||||
testing.sh
|
README.bbcode
|
||||||
.lock
|
|
||||||
tests
|
|
||||||
mwe*
|
|
||||||
test*
|
|
||||||
container*
|
|
||||||
Containerfile
|
|
||||||
README.bbcode
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ $ installJRMC --help
|
|||||||
--compat
|
--compat
|
||||||
Build/install MC without minimum dependency version requirements
|
Build/install MC without minimum dependency version requirements
|
||||||
--mcversion VERSION
|
--mcversion VERSION
|
||||||
Build or install a specific MC version, ex. "33.0.15" (default: latest version)
|
Build or install a specific MC version, ex. "33.0.20" (default: latest version)
|
||||||
--mcrepo REPO
|
--mcrepo REPO
|
||||||
Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: latest official)
|
Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: latest official)
|
||||||
--arch ARCH
|
--arch ARCH
|
||||||
@@ -118,9 +118,9 @@ Multiple services (but not `--service-types`) can be installed at one time using
|
|||||||
|
|
||||||
Install MC from the repository and start/enable `jriver-mediacenter.service` as a user service.
|
Install MC from the repository and start/enable `jriver-mediacenter.service` as a user service.
|
||||||
|
|
||||||
* `installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 33.0.15`
|
* `installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 33.0.20`
|
||||||
|
|
||||||
Build and install an MC 33.0.15 comptability RPM locally and activate it using the `/path/to/license.mjr`
|
Build and install an MC 33.0.20 comptability RPM locally and activate it using the `/path/to/license.mjr`
|
||||||
|
|
||||||
* `installJRMC --createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user`
|
* `installJRMC --createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user`
|
||||||
|
|
||||||
|
|||||||
66
installJRMC
66
installJRMC
@@ -16,9 +16,9 @@
|
|||||||
|
|
||||||
shopt -s extglob
|
shopt -s extglob
|
||||||
|
|
||||||
declare -g SCRIPT_VERSION="1.3.2"
|
declare -g SCRIPT_VERSION="1.3.3"
|
||||||
declare -g BOARD_URL="https://yabb.jriver.com/interact/index.php/board,86.0.html" # MC33
|
declare -g BOARD_URL="https://yabb.jriver.com/interact/index.php/board,86.0.html" # MC33
|
||||||
declare -g MC_VERSION="33.0.15" # Do find all replace
|
declare -g MC_VERSION="33.0.20" # Do find all replace
|
||||||
declare -g MC_DEFAULT_REPO="bullseye" # should match the MC_VERSION
|
declare -g MC_DEFAULT_REPO="bullseye" # should match the MC_VERSION
|
||||||
declare -ig SELF_UPDATE=1
|
declare -ig SELF_UPDATE=1
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ init() {
|
|||||||
(( EUID == 0 )) && err "Running as root user"
|
(( EUID == 0 )) && err "Running as root user"
|
||||||
|
|
||||||
if [[ -f /etc/os-release ]]; then
|
if [[ -f /etc/os-release ]]; then
|
||||||
source "/etc/os-release"
|
source /etc/os-release
|
||||||
else
|
else
|
||||||
err "/etc/os-release not found"
|
err "/etc/os-release not found"
|
||||||
err "Your OS is unsupported"
|
err "Your OS is unsupported"
|
||||||
@@ -156,6 +156,10 @@ init() {
|
|||||||
|
|
||||||
debug "Detected host platform: $ID $VERSION_ID $ARCH"
|
debug "Detected host platform: $ID $VERSION_ID $ARCH"
|
||||||
|
|
||||||
|
# Set defaults
|
||||||
|
BUILD_TARGET="${BUILD_TARGET:-$ID}"
|
||||||
|
REPO_TARGET="${REPO_TARGET:-$ID}"
|
||||||
|
|
||||||
# Normalize ID and set distro-specific vars
|
# Normalize ID and set distro-specific vars
|
||||||
case $ID in
|
case $ID in
|
||||||
debian|arch) ;;
|
debian|arch) ;;
|
||||||
@@ -228,7 +232,7 @@ init() {
|
|||||||
PKG_REMOVE=(execute sudo zypper --non-interactive --quiet remove --clean-deps)
|
PKG_REMOVE=(execute sudo zypper --non-interactive --quiet remove --clean-deps)
|
||||||
PKG_UPDATE=(execute sudo zypper --non-interactive --quiet refresh jriver)
|
PKG_UPDATE=(execute sudo zypper --non-interactive --quiet refresh jriver)
|
||||||
PKG_QUERY=(rpm -q)
|
PKG_QUERY=(rpm -q)
|
||||||
PKG_INSTALL_LOCAL() { install_mc_rpm; }
|
PKG_INSTALL_LOCAL() { install_mc_suse; }
|
||||||
;;
|
;;
|
||||||
arch)
|
arch)
|
||||||
PKG_INSTALL=(execute sudo pacman -Sy --noconfirm)
|
PKG_INSTALL=(execute sudo pacman -Sy --noconfirm)
|
||||||
@@ -256,21 +260,15 @@ parse_input() {
|
|||||||
declare -g BUILD_SWITCH REPO_INSTALL_SWITCH LOCAL_INSTALL_SWITCH \
|
declare -g BUILD_SWITCH REPO_INSTALL_SWITCH LOCAL_INSTALL_SWITCH \
|
||||||
COMPAT_SWITCH TEST_SWITCH CREATEREPO_SWITCH UNINSTALL_SWITCH \
|
COMPAT_SWITCH TEST_SWITCH CREATEREPO_SWITCH UNINSTALL_SWITCH \
|
||||||
YES_SWITCH USER_MC_VERSION MJR_RESTORE_FILE BETAPASS SERVICE_TYPE \
|
YES_SWITCH USER_MC_VERSION MJR_RESTORE_FILE BETAPASS SERVICE_TYPE \
|
||||||
VNCPASS USER_DISPLAY MC_REPO
|
VNCPASS USER_DISPLAY MC_REPO BUILD_TARGET REPO_TARGET
|
||||||
declare -ga SERVICES CONTAINERS
|
declare -ga SERVICES CONTAINERS
|
||||||
local long_opts short_opts input
|
local long_opts short_opts input
|
||||||
|
|
||||||
# Defaults
|
|
||||||
declare -g \
|
|
||||||
BUILD_TARGET="$ID" \
|
|
||||||
REPO_TARGET="$ID" \
|
|
||||||
CREATEREPO_USER="$USER" \
|
|
||||||
OUTPUT_DIR="$SCRIPT_DIR/output" \
|
|
||||||
CREATEREPO_WEBROOT="/var/www/jriver" \
|
|
||||||
USER="${SUDO_USER:-$USER}"
|
|
||||||
|
|
||||||
declare -g SCRIPT_PATH; SCRIPT_PATH=$(readlink -f "${BASH_SOURCE[0]}")
|
declare -g SCRIPT_PATH; SCRIPT_PATH=$(readlink -f "${BASH_SOURCE[0]}")
|
||||||
declare -g SCRIPT_DIR=; SCRIPT_DIR=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")
|
declare -g SCRIPT_DIR=; SCRIPT_DIR=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")
|
||||||
|
declare -g CREATEREPO_USER="$USER"
|
||||||
|
declare -g OUTPUT_DIR="$SCRIPT_DIR/output"
|
||||||
|
declare -g CREATEREPO_WEBROOT="/var/www/jriver"
|
||||||
|
declare -g USER="${SUDO_USER:-$USER}"
|
||||||
declare -g HOME; HOME=$(getent passwd "$USER" | cut -d: -f6)
|
declare -g HOME; HOME=$(getent passwd "$USER" | cut -d: -f6)
|
||||||
|
|
||||||
# Set some defaults if zero or one arguments are passed
|
# Set some defaults if zero or one arguments are passed
|
||||||
@@ -653,27 +651,33 @@ install_mc_repo() {
|
|||||||
acquire_deb() {
|
acquire_deb() {
|
||||||
debug "Running: ${FUNCNAME[0]}"
|
debug "Running: ${FUNCNAME[0]}"
|
||||||
|
|
||||||
declare -g MC_DEB="$OUTPUT_DIR/SOURCES/MediaCenter-$MC_VERSION-$ARCH.deb"
|
local fname="MediaCenter-$MC_VERSION-$ARCH.deb"
|
||||||
|
declare -g MC_DEB="$OUTPUT_DIR/SOURCES/$fname"
|
||||||
|
|
||||||
debug "MC_DEB=$MC_DEB"
|
debug "MC_DEB=$MC_DEB"
|
||||||
|
|
||||||
# If deb file already exists, skip download
|
# If deb file already exists, skip download
|
||||||
if [[ -f $MC_DEB ]]; then
|
if [[ -f $MC_DEB ]]; then
|
||||||
echo "Using existing DEB: $MC_DEB"
|
if [[ $(stat -c%s "$MC_DEB") -lt 10000000 ]]; then
|
||||||
|
echo "Removing existing DEB under 10MB: $MC_DEB"
|
||||||
|
execute rm "$MC_DEB"
|
||||||
|
else
|
||||||
|
echo "Using existing DEB: $MC_DEB"
|
||||||
|
fi
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Define the repositories to check
|
# Define the repositories to check
|
||||||
local repos=(
|
local repos=(
|
||||||
"beta/$BETAPASS"
|
"https://files.jriver-cdn.com/mediacenter/channels/v$MC_MVERSION/latest/$fname"
|
||||||
"latest"
|
"https://files.jriver-cdn.com/mediacenter/test/$fname"
|
||||||
"test"
|
"https://files.jriver-cdn.com/mediacenter/channels/v$MC_MVERSION/beta/$BETAPASS/$fname"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Loop through the repositories and attempt to download
|
# Loop through the repositories and attempt to download
|
||||||
for repo in "${repos[@]}"; do
|
for repo in "${repos[@]}"; do
|
||||||
echo "Checking $repo repo for DEB package"
|
echo "Checking $repo for DEB package"
|
||||||
if execute wget --quiet --output-document "$MC_DEB" \
|
if execute wget --quiet --output-document "$MC_DEB" "$repo"; then
|
||||||
"https://files.jriver-cdn.com/mediacenter/channels/v$MC_VERSION/$repo/MediaCenter-$MC_VERSION-$ARCH.deb"; then
|
|
||||||
echo "Found!"
|
echo "Found!"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
@@ -906,6 +910,16 @@ install_mc_rpm() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Installs Media Center RPM package on SUSE
|
||||||
|
#######################################
|
||||||
|
install_mc_suse() {
|
||||||
|
debug "Running: ${FUNCNAME[0]}"
|
||||||
|
|
||||||
|
install_package --no-install-check --no-gpg-check --allow-downgrades "$MC_RPM"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# Installs Media Center manually
|
# Installs Media Center manually
|
||||||
#######################################
|
#######################################
|
||||||
@@ -914,7 +928,7 @@ install_mc_generic() {
|
|||||||
|
|
||||||
local -a raw_files
|
local -a raw_files
|
||||||
|
|
||||||
echo "Using generic installation method!"
|
echo "Using generic installation method"
|
||||||
|
|
||||||
declare extract_dir && extract_dir="$(mktemp -d)"
|
declare extract_dir && extract_dir="$(mktemp -d)"
|
||||||
pushd "$extract_dir" &>/dev/null || return
|
pushd "$extract_dir" &>/dev/null || return
|
||||||
@@ -1728,8 +1742,8 @@ main() {
|
|||||||
install_package "wget"
|
install_package "wget"
|
||||||
[[ -d $OUTPUT_DIR/SOURCES ]] || execute mkdir -p "$OUTPUT_DIR/SOURCES"
|
[[ -d $OUTPUT_DIR/SOURCES ]] || execute mkdir -p "$OUTPUT_DIR/SOURCES"
|
||||||
acquire_deb || { err "Could not download Media Center DEB package"; return 1; }
|
acquire_deb || { err "Could not download Media Center DEB package"; return 1; }
|
||||||
if [[ $BUILD_TARGET =~ (centos|fedora|suse) \
|
|
||||||
|| $REPO_TARGET =~ (centos|fedora|suse) ]]; then
|
if [[ $BUILD_TARGET =~ (centos|fedora|suse) || $REPO_TARGET =~ (centos|fedora|suse) ]]; then
|
||||||
install_package "dpkg" "rpm-build"
|
install_package "dpkg" "rpm-build"
|
||||||
[[ -d $OUTPUT_DIR/SPECS ]] || execute mkdir -p "$OUTPUT_DIR/SPECS"
|
[[ -d $OUTPUT_DIR/SPECS ]] || execute mkdir -p "$OUTPUT_DIR/SPECS"
|
||||||
build_rpm
|
build_rpm
|
||||||
|
|||||||
Reference in New Issue
Block a user