-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpost_install.sh
executable file
·26 lines (21 loc) · 1.05 KB
/
post_install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
## Who will run the jail's primary service
service_port="8089" # service_port == UID
service_name="movienight" # service_name == username
service_config="/usr/local/etc/${service_name}/settings.json"
service_directory="/usr/local/share/${service_name}"
## Add the service_name user
pw adduser -u "${service_port}" -n "${service_name}" -d /nonexistent -w no -s /nologin
## Configure the jail's primary service
sysrc ${service_name}_user="${service_name}"
sysrc ${service_name}_group="${service_name}"
sysrc ${service_name}_app_dir="${service_directory}"
sysrc ${service_name}_settings="${service_config}"
## Install the jail's primary service, Movie Night
echo -e "\nInstalling Movie Night..."
git clone "https://github.com/zorchenhimer/MovieNight.git" "${service_directory}"
gmake TARGET=freebsd ARCH=amd64 -f "${service_directory}/Makefile" -C "${service_directory}"
## Enable and start the Movie Night service
chmod +x "/usr/local/etc/rc.d/${service_name}"
sysrc -f /etc/rc.conf ${service_name}_enable="YES"
service "${service_name}" start