forked from chrisnharvey/Easy-Linux-Security
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
77 lines (71 loc) · 2.84 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
#!/bin/sh
#
# Copyright (C) 2005 Server Monkeys Services, Richard Gannon and Martynas Bendorius. All Rights Reserved.
#
# Author: Richard Gannon <[email protected]> and Martynas Bendorius <[email protected]>
#
# For questions, comments, and support, please visit:
# www.servermonkeys.com
#
# http://servermonkeys.com/projects/els/
#
# Easy Linux Security (ELS), v. 1.7.0
#
########################################################################################
# Easy Linux Security (ELS) is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the Free Software #
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #
########################################################################################
##
INSTALLDIR=/usr/local/els
MIRROR=http://servermonkeys.com/projects/els
if [ -d /usr/local/rgsecurity ]; then
mv /usr/local/rgsecurity $INSTALLDIR
rm -f $INSTALLDIR/rgsecurity.sh
rm -f $INSTALLDIR/updater.sh
else
mkdir $INSTALLDIR
mkdir $INSTALLDIR/src
mkdir $INSTALLDIR/bakfiles
fi
wget -q --output-document=$INSTALLDIR/versions $MIRROR/versions
if [ "`grep els-core $INSTALLDIR/versions`" = "" ]; then
echo "Failed to download versions file."
echo "Aborting."
rm -f $INSTALLDIR/versions
exit
fi
echo "Downloading..."
wget -q --output-document=$INSTALLDIR/src/els.tar.gz $MIRROR/els.tar.gz
echo "Done."
if [ "`md5sum $INSTALLDIR/src/els.tar.gz | cut -d ' ' -f 1`" = "`grep els-core -m1 $INSTALLDIR/versions | cut -d ':' -f 3`" ]; then
echo "MD5 valid."
else
echo "MD5 invalid. Aborting."
exit
fi
cd $INSTALLDIR/src
echo "Extracting..."
tar -zxf els.tar.gz
cd els/
mv * $INSTALLDIR
chmod -R 700 $INSTALLDIR
cd $INSTALLDIR/src
echo "Done."
rm -rf els.tar.gz els/
rm -f $INSTALLDIR/versions
ln -s /usr/local/els/els.sh /usr/local/bin/els
echo
echo "Easy Linux Security (ELS) successfully installed in $INSTALLDIR"
echo "Type 'els --help' for available options."
exit 0