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