-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·42 lines (34 loc) · 969 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
configFile="installConfig.sh"
# check for installation config
if [ ! -e "$configFile" ]
then
echo "Installation config not found: $configFile"
exit
fi
source $configFile
CONFIG_NAME="config.txt"
# check for server config
if [ ! -e "$CONFIG_NAME" ]
then
echo "MUID service config not found: \"$CONFIG_NAME\""
echo 'edit "sample-config.txt" to match your needs and do'
echo "cp sample-config.txt $CONFIG_NAME"
exit
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
rm -rf $SERVER_DIR/*
echo 'server directory cleaned'
mkdir -p `dirname $CONFIG_PATH`
sudo chown $SERVER_DIR_RIGHTS `dirname $CONFIG_PATH`
cp $CONFIG_NAME $CONFIG_PATH
echo "server config is \"$CONFIG_PATH\""