45 lines
1.0 KiB
Bash
Executable File
45 lines
1.0 KiB
Bash
Executable File
#!/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"
|