3 Commits

Author SHA1 Message Date
bf0587a1a5 Update version number 2022-02-18 18:52:38 -05:00
5042af9b45 Enable forking for jriver-xvnc 2022-02-18 18:48:29 -05:00
ca05ce080a Disable CoW on btrfs for MC dirs 2022-02-17 17:33:01 -05:00

View File

@@ -18,10 +18,11 @@
shopt -s extglob shopt -s extglob
declare -g SCRIPTVERSION="1.0b10" declare -g SCRIPTVERSION="1.0b11"
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}"
declare -g HOME; HOME=$(getent passwd "$USER" | cut -d: -f6)
printHelp() { printHelp() {
debug "Running: ${FUNCNAME[0]}" debug "Running: ${FUNCNAME[0]}"
@@ -84,7 +85,7 @@ printHelp() {
Enable and start a new Xvnc session running JRiver Media Center (system) Enable and start a new Xvnc session running JRiver Media Center (system)
--vncpass PASSWORD --vncpass PASSWORD
Set vnc password for x11vnc/Xvnc access. If no password is set, the script Set vnc password for x11vnc/Xvnc access. If no password is set, the script
will either use existing password stored in ~/.vnc/jrmc_passwd or use no password will either use existing password stored in $HOME/.vnc/jrmc_passwd or use no password
--display DISPLAY --display DISPLAY
Display to start x11vnc/Xvnc (Default: The current display (x11vnc) or the Display to start x11vnc/Xvnc (Default: The current display (x11vnc) or the
current display incremented by 1 (Xvnc)) current display incremented by 1 (Xvnc))
@@ -262,7 +263,7 @@ getVersion() {
VERSION_SOURCE="webscrape" VERSION_SOURCE="webscrape"
# Hardcoded # Hardcoded
else else
MCVERSION="28.0.100" MCVERSION="28.0.106"
VERSION_SOURCE="hardcoded version" VERSION_SOURCE="hardcoded version"
err "Warning! Using hardcoded version number" err "Warning! Using hardcoded version number"
fi fi
@@ -1026,7 +1027,7 @@ service_jriver-xvnc() {
After=multi-user.target After=multi-user.target
[Service] [Service]
Type=simple Type=forking
$USER_STRING $USER_STRING
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill $NEXT_DISPLAY &>/dev/null || :' ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill $NEXT_DISPLAY &>/dev/null || :'
ExecStart=$start_cmd ExecStart=$start_cmd
@@ -1373,6 +1374,29 @@ getOS() {
} }
#######################################
# Detects if MC is installed on btrfs and disables CoW
#######################################
disableCoW() {
debug "Running: ${FUNCNAME[0]}"
declare mc_system_path="/usr/lib/jriver"
declare mc_user_path
mc_user_path=$(getent passwd "$USER" | cut -d: -f6)
for dir in "$mc_system_path" "$mc_user_path"; do
if [[ $(stat -f -c %T "$dir") == "btrfs" ]] &&
! lsattr -d "$dir" | cut -f1 -d" " | grep -q C; then
echo "Disabling CoW for $dir"
sudo chattr -R +C "$dir"
fi
done
}
#######################################
# Completely uninstalls MC, services, and firewall rules
#######################################
uninstall() { uninstall() {
debug "Running: ${FUNCNAME[0]}" debug "Running: ${FUNCNAME[0]}"
@@ -1576,6 +1600,8 @@ main() {
done done
fi fi
disableCoW
# for _container in "${CONTAINERS[@]}"; do # for _container in "${CONTAINERS[@]}"; do
# if ! "_container_$_container"; then # if ! "_container_$_container"; then
# if [[ $? -eq 127 ]]; then # if [[ $? -eq 127 ]]; then