-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtemplate-uninstall.sh
27 lines (22 loc) · 1.5 KB
/
template-uninstall.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
#!/bin/bash
#########################################################################################
# Check if the script is being running by a root or sudoer user #
#########################################################################################
if [ "$(id -u)" != "0" ]; then echo ""; echo "This script must be executed by a root or sudoer user"; echo ""; exit 1; fi
# Parameters
if [ -n "$1" ]; then scriptRootFolder="$1"; else scriptRootFolder="`pwd`/.."; fi
if [ -n "$2" ]; then username="$2"; else username="`whoami`"; fi
if [ -n "$3" ]; then homeFolder="$3"; else homeFolder="$HOME"; fi
# Add common variables
. $scriptRootFolder/common/commonVariables.properties
#########################################################################################
# CONSIDERATIONS #
# - No need to use 'sudo' because this script must be executed as root user. #
# - This script must be non-interactive, this means, no interaction with user at all: #
# * No echo to standard output (monitor) #
# * No read from standard input (keyboard) #
# * Use auto-confirm for commands. Example: apt install -y <package> #
# - No need to remove/purge the application package becouse it's done by main script #
# * etc. #
#########################################################################################
# Commands to remove config files ...