1
0

feat: Add an uninstall script and make systemctl commands in the install script more robust.

This commit is contained in:
2026-02-28 13:13:02 +01:00
parent 4a36400aa1
commit a1037edb29
2 changed files with 24 additions and 2 deletions

View File

@@ -6,8 +6,8 @@ set -e
echo "Building Toak Native AOT executable..." echo "Building Toak Native AOT executable..."
dotnet publish -c Release -r linux-x64 dotnet publish -c Release -r linux-x64
systemctl --user stop toak.service systemctl --user stop toak.service >/dev/null 2>&1 || true
systemctl --user disable toak.service systemctl --user disable toak.service >/dev/null 2>&1 || true
echo "Installing to /usr/bin/toak... (This may prompt for your sudo password)" echo "Installing to /usr/bin/toak... (This may prompt for your sudo password)"
sudo cp bin/Release/net10.0/linux-x64/publish/Toak /usr/bin/toak sudo cp bin/Release/net10.0/linux-x64/publish/Toak /usr/bin/toak

22
uninstall.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
echo "Stopping and disabling Toak systemd service..."
systemctl --user stop toak.service || true
systemctl --user disable toak.service || true
echo "Removing systemd service file..."
sudo rm -f ~/.config/systemd/user/toak.service
systemctl --user daemon-reload
echo "Removing Toak executable..."
sudo rm -f /usr/bin/toak
if [ -f "/usr/share/zsh/site-functions/_toak" ]; then
echo "Removing zsh completions..."
sudo rm -f /usr/share/zsh/site-functions/_toak
fi
echo "Toak has been successfully uninstalled."