Last active
March 17, 2022 09:26
-
-
Save Limych/411342b9b5d572669fdc8c146ed77454 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Require PREF_ADMIN_USER and PREF_ADMIN_PASS variables | |
# Main prepare | |
######################################################################################## | |
rm /etc/localtime | |
ln -s /usr/share/zoneinfo/Europe/Moscow /etc/localtime | |
# | |
pkg update -y && pkg upgrade -y | |
# Install go-ssb-room | |
######################################################################################## | |
pkg install -y go git | |
cd /usr/local/share | |
git clone https://github.com/ssb-ngi-pointer/go-ssb-room.git | |
cd go-ssb-room/cmd/server | |
go build | |
# | |
cat <<EOF >/usr/local/etc/rc.d/ssbroom | |
#!/bin/sh | |
# | |
# Author: Andrey "Limych" Khrolenok (andrey at khrolenok dt ru) | |
# | |
# PROVIDE: ssbroom | |
# REQUIRE: networking | |
# KEYWORD: | |
. /etc/rc.subr | |
name="ssbroom" | |
rcvar="\${name}_enable" | |
load_rc_config \${name} | |
: \${ssbroom_enable:="NO"} | |
pidfile="/var/run/ssbroom.pid" | |
ssbroom_domain=\${ssbroom_domain:-`hostname`} | |
ssbroom_mode=\${ssbroom_mode:-"restricted"} | |
PATH=\$PATH:/usr/local/bin | |
command="/usr/sbin/daemon" | |
command_args="-P \${pidfile} /usr/local/share/go-ssb-room/cmd/server/server -https-domain \\"\$ssbroom_domain\\" -mode \\"\$ssbroom_mode\\" > /dev/null" | |
run_rc_command "\$1" | |
EOF | |
chmod +x /usr/local/etc/rc.d/ssbroom | |
# | |
sysrc "ssbroom_enable=YES" | |
service ssbroom start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment