FreeBSD/jails/config/hub/vncmods/vncserver

45 lines
1.0 KiB
Plaintext
Raw Normal View History

2021-02-13 11:38:38 -08:00
#!/bin/sh
# the two lines below are not just comments but required by rcorder; service -e
# PROVIDE: vncserver
# REQUIRE: NETWORKING SERVERS DAEMON ldconfig resolv
. /etc/rc.subr
: ${vncserver_enable="NO"}
: ${vncserver_user="p"}
: ${vncserver_geometry="1600x900"}
: ${vncserver_display="1"}
: ${vncserver_securitytypes="vncauth"}
# : ${vncserver_securitytypes="vencrypt,vncauth,tlsvnc"}
# encryption incompatible with clients - vncconnect-realvnc and guacd
name=vncserver
rcvar=vncserver_enable
VNCSERVER="/usr/local/bin/vncserver"
start_cmd="vncserver_start"
stop_cmd="vncserver_stop"
restart_cmd="vncserver_restart"
vncserver_start()
{
CMD="$VNCSERVER -geometry ${vncserver_geometry} -name $(hostname -s) -securitytypes ${vncserver_securitytypes} :${vncserver_display}"
su -l ${vncserver_user} -c "${CMD}"
}
vncserver_stop()
{
CMD="$VNCSERVER -kill :${vncserver_display}"
su -l ${vncserver_user} -c "${CMD}"
}
vncserver_restart()
{
vncserver_stop
vncserver_start
}
load_rc_config ${name}
run_rc_command "$1"