Skip to content

Commit

Permalink
uninstall upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaofeng1227 committed Dec 3, 2024
1 parent fec0cb8 commit e9a9fb4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
26 changes: 13 additions & 13 deletions install/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ echo -e "\n---Remove Websoft9 backend service containers---"
sudo docker compose -p websoft9 down -v

echo -e "\n---Remove Websoft9 systemd service---"
sudo systemctl disable websoft9
sudo systemctl stop websoft9
rm -rf /lib/systemd/system/websoft9.service
if systemctl list-units --full --all | grep -Fq websoft9.service; then
sudo systemctl disable websoft9
sudo systemctl stop websoft9
rm -rf /lib/systemd/system/websoft9.service
else
echo "websoft9.service does not exist."
fi

remove_cockpit() {

echo -e "\n---Remove Cockpit---"
sudo systemctl stop cockpit.socket cockpit
sudo systemctl disable cockpit.socket cockpit
Expand All @@ -33,27 +36,24 @@ remove_cockpit() {
apt_status=$?

if [ $dnf_status -eq 0 ]; then
for pkg in $cockpit_packages
do
for pkg in $cockpit_packages; do
echo "Uninstalling $pkg"
sudo dnf remove -y "$pkg" > /dev/null || echo "$pkg failed to uninstall"
done
elif [ $yum_status -eq 0 ]; then
for pkg in $cockpit_packages
do
for pkg in $cockpit_packages; do
echo "Uninstalling $pkg"
sudo yum remove -y "$pkg" > /dev/null || echo "$pkg failed to uninstall"
done
elif [ $apt_status -eq 0 ]; then
export DEBIAN_FRONTEND=noninteractive
for pkg in $cockpit_packages
do
for pkg in $cockpit_packages; do
echo "Uninstalling $pkg"
sudo apt-get remove -y "$pkg" > /dev/null || echo "$pkg failed to uninstall"
done
else
echo "Neither apt,dnf nor yum found. Please install one of them and try again."
end
echo "Neither apt, dnf nor yum found. Please install one of them and try again."
fi # 修正这里,使用 fi 而不是 end

sudo rm -rf /etc/cockpit/*
}
Expand All @@ -66,4 +66,4 @@ remove_files() {
remove_cockpit
remove_files

echo -e "\nCongratulations, Websoft9 uninstall is complete!"
echo -e "\nCongratulations, Websoft9 uninstall is complete!"
1 change: 1 addition & 0 deletions version.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
],
"RedHat": [
"9",
"8",
"7"
],
"CentOS": [
Expand Down

0 comments on commit e9a9fb4

Please sign in to comment.