This repository has been archived by the owner on Feb 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
init.sh
executable file
·64 lines (49 loc) · 1.87 KB
/
init.sh
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
#!/bin/bash
# Clean: Packages
# Module Warning
warning "This module will remove all non-essential packages on this system, you have been warned!"
if ! (question --default yes "Do you still want to run this module and purge all non-essential packages? (Y/n)" || [ $UNATTENDED = 1 ]); then
# Skipped Message
subheader "Skipping Module..."
# Skip Module
continue
fi
# Update Package Lists
subheader "Updating Package Lists..."
package_update
# Create Package List
subheader "Creating Package List..."
cp $MODULEPATH/$MODULE/$DISTRIBUTION/base temp.packages.list
# Check Platform
if [ $PLATFORM = "hardware" ]; then
# Append Hardware Package List
cat $MODULEPATH/$MODULE/$DISTRIBUTION/base-hardware >> temp.packages.list
fi
# Check Platform Package List
if [ -f $MODULEPATH/$MODULE/$DISTRIBUTION/specific-$PLATFORM-$ARCHITECTURE ]; then
# Append Platform Package List
cat $MODULEPATH/$MODULE/$DISTRIBUTION/specific-$PLATFORM-$ARCHITECTURE >> temp.packages.list
fi
# Append Custom Package List
cat $MODULEPATH/$MODULE/$DISTRIBUTION/custom >> temp.packages.list
# Sort Package List
sort -o temp.packages.list temp.packages.list
# Run Pre Install Commands
source $MODULEPATH/$MODULE/$DISTRIBUTION/script-install.sh
# Clean Packages
subheader "Cleaning Packages..."
clean_packages
# Clean Files
subheader "Cleaning Files..."
clean_files
# Run Post Install Commands
source $MODULEPATH/$MODULE/$DISTRIBUTION/script-post.sh
# Remove Temporary Files
rm temp.*
# Clean Packages
package_clean
# Clean Package List
package_clean_list
# Show Warnings
warning "All SSH Servers have been uninstalled! Be sure to install an SSH server again using the modules provided (e.g install-ssh)!"
warning "Also, it is recommend that you restart your server after installing an SSH server to ensure everything is functional (due to kernel updates and such) and to ensure that all changes have been correctly applied."