Update homepage-install.sh

Refactor
This commit is contained in:
tteckster 2024-04-23 10:34:50 -04:00 committed by GitHub
parent c073351b4c
commit dc6c21a85f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 9 deletions

View File

@ -17,11 +17,7 @@ msg_info "Installing Dependencies"
$STD apt-get install -y curl $STD apt-get install -y curl
$STD apt-get install -y sudo $STD apt-get install -y sudo
$STD apt-get install -y mc $STD apt-get install -y mc
$STD apt-get install -y make $STD apt-get install -y gpg
$STD apt-get install -y g++
$STD apt-get install -y gcc
$STD apt-get install -y ca-certificates
$STD apt-get install -y gnupg
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
msg_info "Setting up Node.js Repository" msg_info "Setting up Node.js Repository"
@ -47,11 +43,12 @@ cd /opt/homepage
cp /opt/homepage/src/skeleton/* /opt/homepage/config cp /opt/homepage/src/skeleton/* /opt/homepage/config
$STD pnpm install $STD pnpm install
$STD pnpm build $STD pnpm build
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Installed Homepage v${RELEASE}" msg_ok "Installed Homepage v${RELEASE}"
msg_info "Creating Service" msg_info "Creating Service"
service_path="/etc/systemd/system/homepage.service" cat <<EOF >/etc/systemd/system/homepage.service
echo "[Unit] [Unit]
Description=Homepage Description=Homepage
After=network.target After=network.target
StartLimitIntervalSec=0 StartLimitIntervalSec=0
@ -63,8 +60,9 @@ User=root
WorkingDirectory=/opt/homepage/ WorkingDirectory=/opt/homepage/
ExecStart=pnpm start ExecStart=pnpm start
[Install] [Install]
WantedBy=multi-user.target" >$service_path WantedBy=multi-user.target
$STD systemctl enable --now homepage EOF
systemctl enable -q --now homepage
msg_ok "Created Service" msg_ok "Created Service"
motd_ssh motd_ssh