-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·44 lines (35 loc) · 953 Bytes
/
install.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
configFile="installConfig.sh"
# check for installation config
if [ ! -e "$configFile" ]
then
echo "Installation config not found: $configFile"
exit 1
fi
source $configFile
CONFIG_NAME="config.txt"
# check for server config
if [ ! -e "$CONFIG_NAME" ]
then
echo "URL mapping server config not found: \"$CONFIG_NAME\""
echo "edit \"sample-config.txt\" to match your needs and do"
echo "cp sample-config.txt $CONFIG_NAME"
exit 1
fi
echo "server directory is \"$SERVER_DIR\""
if [ ! -e "$SERVER_DIR" ]
then
# create server directory
echo "directory not present, creating..."
sudo mkdir -p $SERVER_DIR
fi
# set directory rights
sudo chown -R $SERVER_DIR_RIGHTS $SERVER_DIR
echo "set directory rights to \"$SERVER_DIR_RIGHTS\""
# reset server files
if [ "$SERVER_DIR" ]
then
sudo rm -rf /$SERVER_DIR/*
echo "server directory cleaned"
fi
sudo cp $CONFIG_NAME $CONFIG_PATH
echo "server config is \"$CONFIG_PATH\""