Update mafl-install.sh

pull/2562/head
tteckster 1 year ago committed by GitHub
parent 0f91caa8b5
commit 5d7c2d2c55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 16
      install/mafl-install.sh

@ -40,22 +40,24 @@ msg_ok "Installed Node.js"
RELEASE=$(curl -s https://api.github.com/repos/hywax/mafl/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
msg_info "Installing Mafl v${RELEASE}"
wget -q https://github.com/hywax/mafl/archive/refs/tags/v${RELEASE}.tar.gz
$STD tar -xzf v${RELEASE}.tar.gz
tar -xzf v${RELEASE}.tar.gz
mkdir -p /opt/mafl/data
touch /opt/mafl/data/config.yml
wget -q -O /opt/mafl/data/config.yml https://raw.githubusercontent.com/hywax/mafl/main/.example/config.yml
mv mafl-${RELEASE}/* /opt/mafl
rm -rf mafl-${RELEASE}
cd /opt/mafl
export NUXT_TELEMETRY_DISABLED=true
$STD yarn install
$STD yarn build
msg_ok "Installed Mafl v${RELEASE}"
msg_info "Creating Service"
service_path="/etc/systemd/system/mafl.service"
echo "[Unit]
cat <<EOF >/etc/systemd/system/mafl.service
[Unit]
Description=Mafl
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
@ -63,9 +65,11 @@ RestartSec=1
User=root
WorkingDirectory=/opt/mafl/
ExecStart=yarn preview
[Install]
WantedBy=multi-user.target" >$service_path
$STD systemctl enable --now malf
WantedBy=multi-user.target
EOF
systemctl enable -q --now mafl
msg_ok "Created Service"
motd_ssh

Loading…
Cancel
Save