homelab/scripts/deluge/script.sh

36 lines
821 B
Bash
Raw Permalink Normal View History

2023-01-02 16:54:32 +01:00
#!/bin/bash
set -euo pipefail
source "$HL_LIB"
_assert_vars HL_TIMEZONE;
2023-01-02 16:54:32 +01:00
_ch_001-make_dirs() {
mkdir -p ~/deluge /data/deluge;
}
_ch_002-copy_compose() {
cp $(_fill docker-compose.yml.templ) ~/deluge/docker-compose.yml;
}
_ch_003-update_caddy() {
cp deluge.Caddyfile /etc/caddy/conf.d;
2023-01-02 16:54:32 +01:00
sudo systemctl reload caddy.service;
}
_ch_004-install_wg_vpn() {
sudo apt-get install -y wireguard-tools
[ -f /data/deluge/wg-vpn.conf ] || _err "Please create /data/deluge/wg-vpn.conf with correct vpn config"
sudo chown root:root /data/deluge/wg-vpn.conf
sudo chmod 600 /data/deluge/wg-vpn.conf
sudo ln -sf /data/deluge/wg-vpn.conf /etc/wireguard/wg0.conf
sudo systemctl enable --now wg-quick@wg0
}
_ch_005-run_service() {
cd ~/deluge;
docker-compose up -d;
}
_run_checkpoints