diff --git a/ct/stylus.sh b/ct/stylus.sh index 8c3c5568..69ae4a2d 100644 --- a/ct/stylus.sh +++ b/ct/stylus.sh @@ -29,9 +29,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/mmastrac/stylus/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f /opt/stylus/stylus_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/stylus/stylus_version.txt)" ]]; then + if check_for_gh_release "stylus" "mmastrac/stylus"; then msg_info "Stopping $APP" systemctl stop stylus msg_ok "Stopped $APP" @@ -39,7 +37,7 @@ function update_script() { msg_info "Updating $APP" $STD rustup update $STD cargo install-update -a - $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 "Updated $APP" msg_info "Starting $APP" diff --git a/frontend/public/json/stylus.json b/frontend/public/json/stylus.json index 4a8efe03..94b2244d 100644 --- a/frontend/public/json/stylus.json +++ b/frontend/public/json/stylus.json @@ -12,7 +12,7 @@ "documentation": "https://mmastrac.github.io/stylus/", "website": "https://github.com/mmastrac/stylus", "logo": null, - "config_path": "/opt/stylus/", + "config_path": "/opt/stylus/config.yaml", "description": "Stylus (style + status) is a lightweight status page for infrastructure and networks. Configure a set of bash scripts that test the various parts of your infrastructure, set up visualizations with minimal configuration, and Stylus will generate you a dashboard for your system.", "install_methods": [ { @@ -33,7 +33,7 @@ }, "notes": [ { - "text": "Configuration Path: `/opt/stylus/`", + "text": "Configuration Path: `/opt/stylus/config.yaml`", "type": "info" } ] diff --git a/install/stylus-install.sh b/install/stylus-install.sh index 84b9af32..c515ce28 100644 --- a/install/stylus-install.sh +++ b/install/stylus-install.sh @@ -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 </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