aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRustDesk <[email protected]>2023-03-02 21:39:32 +0800
committerGitHub <[email protected]>2023-03-02 21:39:32 +0800
commit9d524443eca89d987fbf7a502e4537be28215cf0 (patch)
treed28e462b36fe7230f63c0e8961c34aac8b92c032
parent12b57238d26b6fda5c428811b214497e062f5021 (diff)
parent35a192a4781f2886eb935c7c9d2e46f9fdf0169c (diff)
downloadrustdesk-server-9d524443eca89d987fbf7a502e4537be28215cf0.tar.gz
rustdesk-server-9d524443eca89d987fbf7a502e4537be28215cf0.zip
Merge pull request #208 from n-connect/master
FreeBSD rcd scripts for hbbs & hbbr
-rw-r--r--rcd/rustdesk-hbbr55
-rw-r--r--rcd/rustdesk-hbbs57
2 files changed, 112 insertions, 0 deletions
diff --git a/rcd/rustdesk-hbbr b/rcd/rustdesk-hbbr
new file mode 100644
index 0000000..ccdf719
--- /dev/null
+++ b/rcd/rustdesk-hbbr
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+# PROVIDE: rustdesk_hbbr
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# rustdesk_hbbr_enable (bool): Set to NO by default.
+# Set it to YES to enable nfs-exporter.
+# rustdesk_hbbr_args (string): Set extra arguments to pass to nfs-exporter
+# Default is "".
+# rustdesk_hbbr_user (string): Set user that rustdesk_hbbr will run under
+# Default is "root".
+# rustdesk_hbbr_group (string): Set group that rustdesk_hbbr will run under
+# Default is "wheel".
+. /etc/rc.subr
+
+name=rustdesk_hbbr
+desc="Rustdesk Relay Server"
+rcvar=rustdesk_hbbr_enable
+
+load_rc_config $name
+
+: ${rustdesk_hbbr_enable:=NO}
+: ${rustdesk_hbbr_args:=""}
+: ${rustdesk_hbbr_user:=rustdesk}
+: ${rustdesk_hbbr_group:=rustdesk}
+
+pidfile=/var/run/rustdesk_hbbr.pid
+command=/usr/sbin/daemon
+procname=/usr/local/sbin/hbbr
+rustdesk_hbbr_chdir="/var/lib/rustdesk-server/"
+rustdesk_hbbr_args="-k _"
+command_args="-f -p ${pidfile} /usr/bin/env ${procname} ${rustdesk_hbbr_args}"
+
+start_precmd=rustdesk_hbbr_startprecmd
+
+rustdesk_hbbr_startprecmd()
+{
+ if [ -e ${pidfile} ]; then
+ chown ${rustdesk_hbbr_user}:${rustdesk_hbbr_group} ${pidfile};
+ else
+ install -o ${rustdesk_hbbr_user} -g ${rustdesk_hbbr_group} /dev/null ${pidfile};
+ fi
+ if [ -e ${rustdesk_hbbr_chdir} ]; then
+ chown -R ${rustdesk_hbbr_user}:${rustdesk_hbbr_group} ${rustdesk_hbbr_chdir};
+ chmod -R 770 ${rustdesk_hbbr_chdir};
+ else
+ mkdir -m 7et nonu
+0 ${rustdesk_hbbr_chdir};
+ chown ${rustdesk_hbbr_user}:${rustdesk_hbbr_group} ${rustdesk_hbbr_chdir};
+ fi
+}
diff --git a/rcd/rustdesk-hbbs b/rcd/rustdesk-hbbs
new file mode 100644
index 0000000..0d3576d
--- /dev/null
+++ b/rcd/rustdesk-hbbs
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+# PROVIDE: rustdesk_hbbs
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# rustdesk_hbbs_enable (bool): Set to NO by default.
+# Set it to YES to enable nfs-exporter.
+# rustdesk_hbbs_args (string): Set extra arguments to pass to nfs-exporter
+# Default is "".
+# rustdesk_hbbs_user (string): Set user that rustdesk_hbbs will run under
+# Default is "root".
+# rustdesk_hbbs_group (string): Set group that rustdesk_hbbs will run under
+# Default is "wheel".
+
+. /etc/rc.subr
+
+name=rustdesk_hbbs
+desc="Rustdesk ID/Rendezvous Server"
+rcvar=rustdesk_hbbs_enable
+
+load_rc_config $name
+
+: ${rustdesk_hbbs_enable:=NO}
+: ${rustdesk_hbbs_args:=""}
+: ${rustdesk_hbbs_user:=rustdesk}
+: ${rustdesk_hbbs_group:=rustdesk}
+
+pidfile=/var/run/rustdesk_hbbs.pid
+command=/usr/sbin/daemon
+procname=/usr/local/sbin/hbbs
+rustdesk_hbbs_chdir="/var/lib/rustdesk-server/"
+rustdesk_hbbs_args="-r your.ip.add.ress -k _"
+command_args="-f -p ${pidfile} /usr/bin/env ${procname} ${rustdesk_hbbs_args}"
+
+start_precmd=rustdesk_hbbs_startprecmd
+
+rustdesk_hbbs_startprecmd()
+{
+ if [ -e ${pidfile} ]; then
+ chown ${rustdesk_hbbs_user}:${rustdesk_hbbs_group} ${pidfile};
+ else
+ install -o ${rustdesk_hbbs_user} -g ${rustdesk_hbbs_group} /dev/null ${pidfile};
+ fi
+ if [ -e ${rustdesk_hbbs_chdir} ]; then
+ chown -R ${rustdesk_hbbs_user}:${rustdesk_hbbs_group} ${rustdesk_hbbs_chdir};
+ chmod -R 770 ${rustdesk_hbbs_chdir};
+ else
+ mkdir -m 770 ${rustdesk_hbbs_chdir};
+ chown ${rustdesk_hbbs_user}:${rustdesk_hbbs_group} ${rustdesk_hbbs_chdir};
+ fi
+}
+
+run_rc_command "$1"