1
0

1 Cometimentos

Autor(a) SHA1 Mensagem Data
4382f14695 Debug - do not use 2020-04-24 17:32:44 -04:00

Ver ficheiro

@@ -27,7 +27,6 @@ installJRMC() {
_createrepo_user="$(whoami)"
_user="$(whoami)"
_available_services=("createrepo" "x11vnc" "mediaserver" "mediacenter" "vncserver")
#_available_containers=("mediacenter-vncserver" "createrepo")
_printHelpAndExit() {
@@ -57,8 +56,6 @@ 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
@@ -78,14 +75,15 @@ OPTIONS
SERVICES
mediaserver
Enable and start a mediaserver systemd service (requires an existing X server)
Create and enable a mediaserver systemd service (requires an existing X server)
mediacenter
Enable and start a mediacenter systemd service (requires an existing X server)
Create and enable a mediacenter systemd service (requires an existing X server)
x11vnc
Enable and start x11vnc for the local desktop (requires an existing X server)
Create and enable an x11vnc server (requires an existing X server)
--vncpass and --display are valid options (see below)
mediacenter-vncserver
Enable and start a vncserver
vncserver
Create and enable a new VNC X server
--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
@@ -95,9 +93,11 @@ OPTIONS
createrepo
Install hourly service to build latest MC RPM and run createrepo
TODO:
CONTAINERS
mediacenter-vncserver (Under construction!)
createrepo (Under construction!)
mediaserver
mediacenter
createrepo
EOF
# Exit using passed exit code
@@ -109,7 +109,7 @@ EOF
_runDebug "${FUNCNAME[0]}"
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
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
eval set -- "$_input"
while true; do
case "$1" in
@@ -138,9 +138,6 @@ EOF
--service|-s)
shift && _services+=("$1")
;;
--container|-c)
shift && _containers+=("$1")
;;
--version|-v)
echo "Version: $_scriptversion"
exit 0
@@ -1024,9 +1021,6 @@ EOF"
}
#######################################
# SERVICES
#######################################
_serviceMediaserver() {
_runDebug "${FUNCNAME[0]}"
@@ -1093,12 +1087,26 @@ 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
@@ -1109,8 +1117,6 @@ EOF"
fi
fi
local _port=$(( ${_display#:} + 5900 ))
_bash_cmd "cat <<-EOF > $_service_fname
[Unit]
Description=Remote desktop service (VNC)
@@ -1127,8 +1133,6 @@ 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\""
}
@@ -1196,20 +1200,6 @@ EOF"
}
#######################################
# CONTAINERS
#######################################
_containerCreaterepo() {
:
}
_containerVNC() {
:
}
_uninstall() {
_runDebug "${FUNCNAME[0]}"
@@ -1325,25 +1315,12 @@ EOF"
mediacenter)
_serviceMediacenter
;;
mediacenter-vncserver)
vncserver)
_serviceVNC
;;
*)
esac
done
# Install containers
for _container in "${_containers[@]}"; do
case "$_container" in
createrepo)
_containerCreaterepo
;;
mediacenter-vncserver)
_containerVNC
;;
*)
esac
done
}
}