-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·81 lines (64 loc) · 2.38 KB
/
install.sh
File metadata and controls
executable file
·81 lines (64 loc) · 2.38 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
LOG_FILE="/var/log/conversion_status.log"
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
log() {
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1" | tee -a "$LOG_FILE"
}
source scripts/run.sh
source scripts/editions/core.sh
source scripts/editions/home.sh
source scripts/editions/security.sh
source scripts/editions/htb.sh
check_system() {
log "Performing system checks..."
# Simple check if running Debian
if ! grep -q "Debian" /etc/os-release; then
log "ERROR: This script requires Debian"
return 1
fi
local required_space=15000 # 15GB in MB
local available_space=$(df -m / | awk 'NR==2 {print $4}')
if [ "$available_space" -lt "$required_space" ]; then
log "ERROR: Insufficient disk space. Required: 15 GB, Available: ${available_space}MB"
return 1
fi
log "System checks passed successfully"
return 0
}
display_menu() {
clear
echo "╔═════════════════════════════════════════════╗"
echo "║ UoWM Debian Conversion Script ║"
echo "╠═════════════════════════════════════════════╣"
echo "║ 1) core ║"
echo "║ Install all of the department's programs ║"
echo "║ 2) Exit ║"
echo "╚═════════════════════════════════════════════╝"
}
install_edition() {
local edition=$1
log "Starting installation of $edition"
if ! check_system; then
log "System checks failed. Installation aborted."
return 1
fi
log "Updating package lists..."
apt-get update
case $edition in
"core") core ;;
*) log "Invalid edition selected"; return 1 ;;
esac
log "Installation of $edition edition completed successfully!"
}
touch "$LOG_FILE"
log "Installation script started..."
while true; do
display_menu
read -p "Enter the option number: " option
case $option in
1) install_edition "core" ;;
2) log "Exiting installation script..."; exit 0 ;;
*) echo "Invalid option. Please try again." ;;
esac
read -p "Press Enter to continue..."
done