-
-
Notifications
You must be signed in to change notification settings - Fork 256
/
pre
38 lines (30 loc) · 630 Bytes
/
pre
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
# shellcheck disable=2034
function f_pre {
SCRIPT_COUNT="0"
((SCRIPT_COUNT++))
export TERM=linux
export DEBIAN_FRONTEND=noninteractive
if [[ $VERBOSE == "Y" ]]; then
APTFLAGS='--assume-yes'
else
APTFLAGS='-qq --assume-yes'
fi
APT="apt-get $APTFLAGS"
readonly APTFLAGS
readonly APT
if [[ $CHANGEME == "" ]]; then
echo "Please read the code. Exiting."
echo
exit 1
fi
if [ "$EUID" -ne 0 ]; then
echo "Not root or not enough privileges. Exiting."
echo
exit 1
fi
if ! lsb_release -i | grep 'Ubuntu'; then
echo "Ubuntu only. Exiting."
echo
exit 1
fi
}