Skip to content

Commit

Permalink
standardizing
Browse files Browse the repository at this point in the history
  • Loading branch information
msimerson committed Mar 24, 2024
1 parent 936c651 commit 5366cec
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 17 deletions.
4 changes: 4 additions & 0 deletions provision/certbot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

. mail-toaster.sh || exit

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

install_certbot()
{
tell_status "installing certbot"
Expand Down
4 changes: 2 additions & 2 deletions provision/clamav.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

set -e

. mail-toaster.sh

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

. mail-toaster.sh

install_clamav_fangfrisch()
{
if [ "$CLAMAV_FANGFRISCH" = "0" ]; then return; fi
Expand Down
15 changes: 9 additions & 6 deletions provision/tinydns.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/bin/sh

. mail-toaster.sh || exit
. include/djb.sh || exit
set -e

. mail-toaster.sh

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

mt6-include djb

configure_tinydns()
{
configure_svscan
Expand Down Expand Up @@ -48,16 +51,16 @@ test_tinydns()
fi

tell_status "testing UDP DNS query"
drill "$_fqdn" @"$(get_jail_ip stage)" || exit
drill "$_fqdn" @"$(get_jail_ip stage)"

tell_status "testing TCP DNS query"
drill -t "$_fqdn" @"$(get_jail_ip stage)" || exit
drill -t "$_fqdn" @"$(get_jail_ip stage)"

tell_status "switching tinydns IP to deployment IP"
get_jail_ip tinydns | tee "$STAGE_MNT/var/service/tinydns/env/IP" "$STAGE_MNT/var/service/axfrdns/env/IP"
get_jail_ip6 tinydns | tee "$STAGE_MNT/var/service/tinydns-v6/env/IP" "$STAGE_MNT/var/service/axfrdns-v6/env/IP"

stage_exec service svscan stop || exit
stage_exec service svscan stop
for d in tinydns axfrdns tinydns-v6 axfrdns-v6
do
if [ -d "$ZFS_DATA_MNT/tinydns/service/$d" ]; then
Expand All @@ -70,7 +73,7 @@ test_tinydns()
stage_sysrc svscan_servicedir="/data/service"
}

base_snapshot_exists || exit
base_snapshot_exists || exit 1
create_staged_fs tinydns
start_staged_jail tinydns
install_daemontools
Expand Down
8 changes: 5 additions & 3 deletions provision/unifi.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/sh

. mail-toaster.sh || exit
set -e

. mail-toaster.sh

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
Expand All @@ -10,10 +12,10 @@ proc $ZFS_JAIL_MNT/unifi/proc procfs rw 0 0"
install_unifi()
{
tell_status "installing Unifi deps"
stage_pkg_install mongodb44 openjdk17 snappyjava gmake || exit
stage_pkg_install mongodb44 openjdk17 snappyjava gmake

tell_status "installing Unifi"
stage_port_install net-mgmt/unifi8 || exit
stage_port_install net-mgmt/unifi8

tell_status "Enable UniFi"
stage_sysrc unifi_enable=YES
Expand Down
8 changes: 5 additions & 3 deletions provision/whmcs.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/sh

. mail-toaster.sh || exit
set -e

. mail-toaster.sh

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
Expand All @@ -15,7 +17,7 @@ install_whmcs()
install_php 81 "ctype curl filter gd iconv imap mbstring session soap xml zip zlib"
install_nginx whmcs

stage_port_install devel/ioncube || exit
stage_port_install devel/ioncube
}

configure_whmcs_nginx()
Expand Down Expand Up @@ -95,7 +97,7 @@ test_whmcs()
echo "it worked"
}

base_snapshot_exists || exit
base_snapshot_exists || exit 1
create_staged_fs whmcs
mkdir -p "$STAGE_MNT/usr/local/share/GeoIP"
start_staged_jail
Expand Down
8 changes: 5 additions & 3 deletions provision/wordpress.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/sh

. mail-toaster.sh || exit
set -e

. mail-toaster.sh

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
Expand All @@ -17,7 +19,7 @@ install_wordpress()
install_php 81 "ctype curl dom exif fileinfo filter ftp gd iconv intl mbstring mysqli pecl-imagick-im7 session tokenizer xml zip zlib"

# stage_pkg_install wordpress
stage_port_install www/wordpress || exit
stage_port_install www/wordpress
}

configure_nginx_server()
Expand Down Expand Up @@ -137,7 +139,7 @@ configure_wp_config()
local _installed_config="$_wp_install/wp-config.php"
if [ -f "$_installed_config" ]; then
tell_status "preserving wp-config.php"
cp "$_installed_config" "$STAGE_MNT/usr/local/www/wordpress/" || exit
cp "$_installed_config" "$STAGE_MNT/usr/local/www/wordpress/"
return
else
tell_status "post-install configuration will be required"
Expand Down

0 comments on commit 5366cec

Please sign in to comment.