-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.sh
More file actions
executable file
·58 lines (46 loc) · 1.39 KB
/
uninstall.sh
File metadata and controls
executable file
·58 lines (46 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# Ubuntu Resource Monitor - Uninstallation Script
set -e
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
INSTALL_DIR="/opt/ubuntu-resource-monitor"
SERVICE_NAME="ubuntu-resource-monitor"
print_message() {
local color=$1
local message=$2
echo -e "${color}${message}${NC}"
}
# Check if running as root
if [ "$EUID" -ne 0 ]; then
print_message "$RED" "❌ Bu skript root olaraq çalışdırılmalıdır. 'sudo' istifadə edin."
exit 1
fi
print_message "$BLUE" "🗑️ Ubuntu Resource Monitor silinir..."
echo ""
# Stop service
if systemctl is-active --quiet "$SERVICE_NAME"; then
print_message "$YELLOW" "⏹️ Servis dayandırılır..."
systemctl stop "$SERVICE_NAME"
fi
# Disable service
if systemctl is-enabled --quiet "$SERVICE_NAME" 2>/dev/null; then
print_message "$YELLOW" "🔓 Servis deaktiv edilir..."
systemctl disable "$SERVICE_NAME"
fi
# Remove service file
if [ -f "/etc/systemd/system/${SERVICE_NAME}.service" ]; then
print_message "$YELLOW" "📝 Servis faylı silinir..."
rm "/etc/systemd/system/${SERVICE_NAME}.service"
systemctl daemon-reload
fi
# Remove installation directory
if [ -d "$INSTALL_DIR" ]; then
print_message "$YELLOW" "📦 Quraşdırma qovluğu silinir..."
rm -rf "$INSTALL_DIR"
fi
print_message "$GREEN" "✅ Ubuntu Resource Monitor uğurla silindi!"
echo ""