-
Notifications
You must be signed in to change notification settings - Fork 1
/
preflight.sh
executable file
·68 lines (51 loc) · 1.26 KB
/
preflight.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
65
66
67
68
#!/bin/bash
# Post installation script
createGit() {
mkdir -p "/home/$USER/.config/aerofoil/git"
}
checkRoot() {
if [[ ! "$(id -u)" -eq 0 ]]; then
echo "Must be run as root"
exit 1
fi
}
checkConnection() {
wget -q --tries=10 --timeout=5 -O - http://ftp.debian.org/debian/README > /dev/null
if [[ $? -eq 0 ]]; then
echo "Connection successful"
else
"Could not connect to ftp.debian.org. There might be a problem with your internet connection"
fi
}
## Imports
importPrompt() {
if [[ -f ${LIBDIR}/prompt ]]; then
source ${LIBDIR}/prompt
else
echo "Could not find prompt"
exit 1
fi
}
LIBDIR='/usr/lib/lib-preflight'
createGit
checkRoot
checkConnection
importPrompt
# Run through steps
STEPS_BASIC=('apt-update' 'apt-dist-upgrade' 'install-af-audio' 'install-alternation' 'install-af-java' 'install-af-desktop' 'install-af-utils' 'install-af-graphics' 'devel')
STEPS_DEVEL=('install-af-cad' 'install-af-cpp')
STEP=1
(( STEPS = ${#STEPS_BASIC[@]} + ${#STEPS_DEVEL[@]} + 2 )) # 2 is intro and fini
. "$LIBDIR/intro"
for curStep in "${STEPS_BASIC[@]}"; do
((STEP++))
. "$LIBDIR/$curStep"
done
if [[ $DEVEL ]]; then
for curStep in "${STEPS_DEVEL[@]}"; do
((STEP++))
. "$LIBDIR/$curStep"
done
fi
. "$LIBDIR/fini"
exit 0