From b30a62bb963d59bfde7d9b4fe7b094299d3a4415 Mon Sep 17 00:00:00 2001 From: pyro Date: Wed, 30 Sep 2026 14:46:37 -0500 Subject: [PATCH] added an update script to update tetanus for you! --- src/main.rs | 1 + update.sh | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 update.sh diff --git a/src/main.rs b/src/main.rs index 1f1ab60..5f68fc5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -158,6 +158,7 @@ async fn main() { banner.lines().for_each(|line| { appstate.output.push(line.to_string()); }); + let handles = Arc::new(Mutex::new(Vec::new())); let handles_clone = handles.clone(); let primary_handle = spawn(move || { diff --git a/update.sh b/update.sh new file mode 100644 index 0000000..f0a322c --- /dev/null +++ b/update.sh @@ -0,0 +1,20 @@ +#!/bin/bash +current_version=$(cat ./version | grep version | cut -d " " -f 2) +path=$(cat ./version | grep path | cut -d " " -f 2) +version=$(curl https://git.pyro.monster/pyro/tetanus/releases/tag/latest | grep "" | cut -d ">" -f 2 | cut -d " " -f 1) + +if [[ "$version" == "$current_version" ]]; then + echo "up to date" +else + echo "update needed" + curl https://git.pyro.monster/pyro/tetanus/releases/download/latest/tetanus -o new_tetanus + chmod +x ./new_tetanus + if [ "$(stat -c '%u' $path)" -eq 0 ]; then + sudo cp ./new_tetanus $path + else + cp ./new_tetanus $path + fi + echo "version: $version" > ./version + echo "path: $path" >> ./version + echo update complete! +fi