-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathodroid-server.sh
More file actions
executable file
·53 lines (45 loc) · 1000 Bytes
/
Copy pathodroid-server.sh
File metadata and controls
executable file
·53 lines (45 loc) · 1000 Bytes
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
#!/bin/bash
# ODROID Server Setup
# For debug uncomment
# set -x
# Global defines
HOMEDIR="/root/odroid-server"
check_root()
{
if [ $UID -ne 0 ]; then
echo -e "\033[1;31mYou must run this script with root priviledges.\033[0;0m"
echo -e "try \033[1;36msudo $0\033[0;0m"
exit 0
fi
prerequirements
# only move on if requirements are met
if [ $? -eq 0 ]; then
update_scripts
fi
}
prerequirements()
{
# check if something is missing
[ -f /bin/whiptail ] || requires="whiptail"
[ -f /usr/bin/git ] || requires="$requires git"
if [ ! -z $requires ]; then
echo -e "\033[1;36mWe wanna make sure necessary packages are installed\033[0;0m"
sleep 5
get_updates
# in case someone removed these
apt-get -y install $requires
fi
}
update_scripts()
{
echo -e "\033[1;36mMake sure we have the latest version of the scripts\033[0;0m"
sleep 3
cd $HOMEDIR
git pull
}
# load extra functions
. $HOMEDIR/functions.sh
# check permissions
check_root
# load menu
. menu.sh