-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·49 lines (40 loc) · 1.09 KB
/
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
44
45
46
47
48
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 "image gallery 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
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
echo "storage directory is \"$STORAGE_DIR\""
if [ ! -e "$STORAGE_DIR" ]
then
# create storage directory
echo "directory not present, creating..."
sudo mkdir -p $STORAGE_DIR
fi
# set directory rights
sudo chown -R $SERVER_DIR_RIGHTS $SERVER_DIR
sudo chown -R $SERVER_DIR_RIGHTS $STORAGE_DIR
echo "set directory rights to \"$SERVER_DIR_RIGHTS\""
# reset server files
rm -rf $SERVER_DIR/*
echo "server directory cleaned"
cp $CONFIG_NAME $CONFIG_PATH
echo "server config is \"$CONFIG_PATH\""