1 Commits

Author SHA1 Message Date
6bf12a7400 Debug - do not use 2020-04-24 17:57:52 -04:00

View File

@@ -27,6 +27,7 @@ installJRMC() {
_createrepo_user="$(whoami)"
_user="$(whoami)"
_available_services=("createrepo" "x11vnc" "mediaserver" "mediacenter" "vncserver")
#_available_containers=("mediacenter-vncserver" "createrepo")
_printHelpAndExit() {
@@ -56,6 +57,8 @@ OPTIONS
Enter beta team password for access to beta builds
--service, -s SERVICE
See SERVICES section below for a list of possible services to install
--container, -c CONTAINER
See CONTAINERS section below for a list of possible services to install
--createrepo
Build rpm, copy to webroot, and run createrepo
--createrepo-webroot PATH
@@ -75,15 +78,14 @@ OPTIONS
SERVICES
mediaserver
Create and enable a mediaserver systemd service (requires an existing X server)
Enable and start a mediaserver systemd service (requires an existing X server)
mediacenter
Create and enable a mediacenter systemd service (requires an existing X server)
Enable and start a mediacenter systemd service (requires an existing X server)
x11vnc
Create and enable an x11vnc server (requires an existing X server)
Enable and start x11vnc for the local desktop (requires an existing X server)
--vncpass and --display are valid options (see below)
vncserver
Create and enable a new VNC X server
mediacenter-vncserver
Enable and start a vncserver
--vncpass PASSWORD
Set vnc password for x11vnc access. If no password is set, the script will either
use existing password stored in ~/.vnc/jrmc_passwd or use no password
@@ -93,11 +95,9 @@ OPTIONS
createrepo
Install hourly service to build latest MC RPM and run createrepo
TODO:
CONTAINERS
mediaserver
mediacenter
createrepo
mediacenter-vncserver (Under construction!)
createrepo (Under construction!)
EOF
# Exit using passed exit code
@@ -109,7 +109,7 @@ EOF
_runDebug "${FUNCNAME[0]}"
if _input=$(getopt -o +vdhus: -l repo-install,rpmbuild-install,rpmbuild,outputdir:,mcversion:,restorefile:,betapass:,service:,version,debug,force,help,uninstall,createrepo,createrepo-webroot:,createrepo-user:,vncpass:,display: -- "$@"); then
if _input=$(getopt -o +vdhus:c: -l repo-install,rpmbuild-install,rpmbuild,outputdir:,mcversion:,restorefile:,betapass:,service:,version,debug,force,help,uninstall,createrepo,createrepo-webroot:,createrepo-user:,vncpass:,display:,container: -- "$@"); then
eval set -- "$_input"
while true; do
case "$1" in
@@ -138,6 +138,9 @@ EOF
--service|-s)
shift && _services+=("$1")
;;
--container|-c)
shift && _containers+=("$1")
;;
--version|-v)
echo "Version: $_scriptversion"
exit 0
@@ -1021,6 +1024,9 @@ EOF"
}
#######################################
# SERVICES
#######################################
_serviceMediaserver() {
_runDebug "${FUNCNAME[0]}"
@@ -1087,26 +1093,12 @@ EOF"
_setVNCPass
if [[ -n $_novncauth ]]; then
_exec_start_cmd="/usr/bin/vncserver $_display -geometry 1440x900 -alwaysshared -fg -SecurityTypes None -xstartup $HOME/.vnc/jrmc-xstartup"
else
_exec_start_cmd="/usr/bin/vncserver $_display -geometry 1440x900 -alwaysshared -fg -rfbauth $HOME/.vnc/jrmc_passwd -xstartup $HOME/.vnc/jrmc-xstartup"
fi
if [[ -n $_novncauth ]]; then
_exec_start_cmd="/usr/bin/vncserver $_display -geometry 1440x900 -alwaysshared -fg -SecurityTypes None -xstartup /usr/bin/mediacenter$_mversion"
else
_exec_start_cmd="/usr/bin/vncserver $_display -geometry 1440x900 -alwaysshared -fg -rfbauth $HOME/.vnc/jrmc_passwd -xstartup /usr/bin/mediacenter$_mversion"
fi
if [[ -n $_novncauth ]]; then
_exec_start_cmd="/usr/bin/vncserver $_display -geometry 1440x900 -alwaysshared -fg -SecurityTypes None -xstartup /usr/bin/xterm"
else
_exec_start_cmd="/usr/bin/vncserver $_display -geometry 1440x900 -alwaysshared -fg -rfbauth $HOME/.vnc/jrmc_passwd -xstartup /usr/bin/xterm"
fi
echo "mediacenter$_mversion" > "$HOME/.vnc/jrmc-xstartup"
if [[ -z $_display ]]; then
# If we are running on existing X server then increment DISPLAY by one
if [[ -n $DISPLAY ]]; then
@@ -1117,6 +1109,8 @@ EOF"
fi
fi
local _port=$(( ${_display#:} + 5900 ))
_bash_cmd "cat <<-EOF > $_service_fname
[Unit]
Description=Remote desktop service (VNC)
@@ -1133,6 +1127,8 @@ ExecStop=/usr/bin/vncserver -kill $_display
WantedBy=multi-user.target
EOF"
_systemctl_reload && _systemctl_enable "$_service_name"
echo "vncserver service should be running on localhost:$_port"
echo "You can diagnose issues using \"sudo systemctl status $_service_name\""
}
@@ -1200,6 +1196,20 @@ EOF"
}
#######################################
# CONTAINERS
#######################################
_containerCreaterepo() {
:
}
_containerVNC() {
:
}
_uninstall() {
_runDebug "${FUNCNAME[0]}"
@@ -1315,12 +1325,25 @@ EOF"
mediacenter)
_serviceMediacenter
;;
vncserver)
mediacenter-vncserver)
_serviceVNC
;;
*)
esac
done
# Install containers
for _container in "${_containers[@]}"; do
case "$_container" in
createrepo)
_containerCreaterepo
;;
mediacenter-vncserver)
_containerVNC
;;
*)
esac
done
}
}