From 2a9e3dc7f1c7ba514b2a18051835943ce46d0533 Mon Sep 17 00:00:00 2001 From: Steven Seifried Date: Sun, 9 Oct 2022 20:35:30 +0200 Subject: [PATCH] Updated snowflake-install.sh --- setup_files/snowflake-install.sh | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/setup_files/snowflake-install.sh b/setup_files/snowflake-install.sh index 6547b8d..2ea4438 100644 --- a/setup_files/snowflake-install.sh +++ b/setup_files/snowflake-install.sh @@ -76,12 +76,32 @@ msg_ok "Installed Dependencies" msg_info "Install Snowflake" useradd -rm snowflake su snowflake -c "cd /home/snowflake && git clone https://git.torproject.org/pluggable-transports/snowflake.git && cd /home/snowflake/snowflake/proxy && go build" -wget https://raw.githubusercontent.com/StevenSeifried/proxmox-scripts/main/systemd_files/snowflake.service -O /etc/systemd/system/snowflake.service -chmod 644 /etc/systemd/system/snowflake.service -systemctl daemon-reload -systemctl enable --now snowflake.service msg_ok "Installed Snowflake" +msg_info "Creating Service" +cat << 'EOF' > /etc/systemd/system/snowflake.service +[Unit] +Description=Snowflake +Wants=network.target +After=syslog.target network-online.target +StartLimitIntervalSec=300 +StartLimitBurst=10 + +[Service] +Type=simple +ExecStart=/home/snowflake/snowflake/proxy/proxy -log /home/snowflake/snowflake.log +Restart=on-failure +RestartSec=5 +KillMode=process +User=snowflake +Group=snowflake + +[Install] +WantedBy=multi-user.target +EOF +ln -s /usr/share/jellyfin/web/ /usr/lib/jellyfin/bin/jellyfin-web +msg_ok "Created Service" + PASS=$(grep -w "root" /etc/shadow | cut -b6); if [[ $PASS != $ ]]; then msg_info "Customizing Container" @@ -97,6 +117,8 @@ ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,3840 EOF systemctl daemon-reload systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//') +systemctl enable --now snowflake.service + msg_ok "Customized Container" msg_info "Cleaning up" apt-get autoremove >/dev/null