forked from loadavg/loadavg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·89 lines (75 loc) · 2.67 KB
/
configure
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/sh
###
# LoadAvg - Server Monitoring & Analytics
# http://www.loadavg.com
#
# Configure Script
#
# @link https://github.com/loadavg/loadavg
# @author Karsten Becker
# @copyright 2014 Sputnik7
#
# This file is licensed under the Affero General Public License version 3 or
# later.
##
if [ "$(id -u)" != "0" ]; then
echo "ALERT:"
echo "You need to be root to run the configure script."
echo "If you are not root you can try the following:"
echo ""
echo "> sudo ./configure"
echo ""
exit 1
else
echo -e "\n\n\n\n[*] Welcome to the LoadAvg 2.2 Configuration Tool"
echo "====================================================================="
echo "Copyright (C) 2015 Sputnik7"
echo "This program comes with ABSOLUTELY NO WARRANTY"
echo "This is free software, and you are welcome to redistribute it"
echo "under certain conditions. See COPYRIGHT for more information."
echo ""
echo "Configuring LoadAvg for installation..."
echo ""
chmod 0777 app/
chmod 0777 app/config/
echo -n "[+] Checking for settings.ini.php in app/config folder ... "
if [ ! -f "app/config/settings.ini.php" ]; then
echo "SETTINGS NOT FOUND"
echo -n "[*] Assuming new install! Creating it from default ... "
cp app/config/default_settings.ini.php app/config/settings.ini.php
echo "DONE"
else
echo "OK"
fi
chmod 0777 app/config/*.ini.php
chmod 0777 lib/modules/*/*.ini.php
chmod 0777 lib/plugins/*/*.ini.php
echo "[+] Checking status of install script"
if [ -f "install/index.php" ]; then
chmod 0777 install/index.php
else
echo " Install script already removed"
fi
if [ -d "install" ]; then
chmod 0777 install
else
echo " Install folder already removed"
fi
if [ -d "lib/modules/Server" ]; then
rm -vr lib/modules/Server
else
echo " Old server not present = good"
fi
echo -n "[+] Checking for /logs folder ... "
if [ ! -d "logs" ]; then
echo "NOT FOUND"
echo -n "[*] Folder /logs does not exists! Creating it ... "
mkdir logs
echo "DONE"
else
echo "OK"
fi
echo "[+] All done. (You can now go to: http://host/ to set up LoadAvg...)"
chmod 0777 logs
echo -e "=====================================================================\n\n\n"
fi