Added new check_for_gh_release function and changed version file to new home. Config path now points to a file. Revisioned cat command on install script.

This commit is contained in:
Luís Oliveira
2025-09-05 12:53:50 +01:00
parent 2dcc7736dc
commit 9be8f3724c
3 changed files with 8 additions and 9 deletions

View File

@@ -30,20 +30,21 @@ msg_ok "Installed Rust"
msg_info "Installing Stylus"
$STD cargo install stylus
$STD stylus init /opt/stylus/
$STD su -c "cargo install --list | grep 'stylus' | cut -d' ' -f2 | sed 's/^v//;s/:$//' > /opt/stylus/stylus_version.txt"
$STD su -c "cargo install --list | grep 'stylus' | cut -d' ' -f2 | sed 's/^v//;s/:$//' > ~/.stylus"
msg_ok "Installed Stylus"
msg_info "Creating service"
cat >/etc/systemd/system/stylus.service <<EOF
cat <<EOF >/etc/systemd/system/stylus.service
[Unit]
Description=Stylus
Description=Stylus Service
After=network.target
[Service]
Type=simple
ExecStart=$HOME/.cargo/bin/stylus run /opt/stylus
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target