This repository has been archived on 2024-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
thelinuxlist/scripts/gitearemove.sh
2023-08-04 01:30:15 -07:00

33 lines
876 B
Bash

#!/usr/bin/env bash
trap 'exit 130' INT
while true
do
read -r -p "Would you like to uninstall Gitea? This is not reversible. [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
break
;;
[nN][oO]|[nN])
break
;;
*)
echo "That wasn't an option..."
;;
esac
done
sudo systemctl stop gitea
sudo systemctl disable gitea
sudo rm -rf /etc/systemd/system/gitea.service
echo "Backing up Files"
tar -cvzf gitea.tar.gz /var/lib/gitea/ /etc/gitea
sudo rm -rf /home/git
sudo userdel git
sudo rm -rf /usr/local/bin/gitea
sudo rm -rf /var/lib/gitea/*
sudo rm -rf /etc/gitea
sudo ufw delete allow 3000
echo "Gitea has been uninstalled, and all files have are backed up in gitea.tar.gz, you can delete it at your discretion."