forked from dynamicpacket-public/monast
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·78 lines (64 loc) · 1.64 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
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
#!/bin/bash
## default paths
MONASTPATH=/opt/monast
HTMLPATH=/var/www/html/monast
BINPATH=/usr/bin
CONFIGPATH=/etc
INITD=/etc/init.d
if [ "$(whoami)" != "root" ]; then
echo -e "\nYou must be root to run this instalation script...\n"
exit 1
fi
echo
echo -n "MonAst base path [${MONASTPATH}]: "
read tmp
if [ "${tmp}" != "" ]; then
MONASTPATH=$tmp
fi
echo -n "MonAst HTML path [${HTMLPATH}]: "
read tmp
if [ "${tmp}" != "" ]; then
HTMLPATH=$tmp
fi
inst=1
echo
if [ -d $MONASTPATH ]; then
echo -n "MonAst already instaled on this system. Overrite? [y/n]: "
read tmp
if [ "${tmp}" != "y" ]; then
inst=0
fi
fi
if [ $inst -eq 1 ]; then
mkdir -p $MONASTPATH
cp -rf pymon/. $MONASTPATH/
echo "MonAst instaled at ${MONASTPATH}"
mkdir -p $HTMLPATH
cp -rf *.php css image template lib js $HTMLPATH/
echo "HTML files instaled at ${HTMLPATH}"
if [ ! -L $BINPATH/monast ]; then
ln -s $MONASTPATH/monast.py $BINPATH/monast
echo "Symbolic link to monast.py created at ${BINPATH}/monast"
fi
if [ ! -f /etc/monast.conf ]; then
cp pymon/monast.conf.sample /etc/monast.conf
echo "Sample monast.conf created at ${CONFIGPATH}/monast.conf"
fi
if [ -f /etc/slackware-version ]; then
cp contrib/slackware/rc.monast /etc/rc.d/rc.monast
echo "Instaling rc.d scripts"
fi
if [ -f /etc/redhat-release ]; then
cp contrib/init.d/rc.redhat.monast $INITD/monast
echo "Instaling init.d scripts"
fi
if [ -f /etc/debian-release ]; then
cp contrib/init.d/rc.debian.monast $INITD/monast
echo "Instaling init.d scripts"
fi
if [ -f /etc/SuSE-release ]; then
cp contrib/init.d/rc.suse.monast $INITD/monast
echo "Instaling init.d scripts"
fi
fi
echo