-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·112 lines (99 loc) · 3.33 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/bash
##########################################################################
#
# Neet: Network discovery, enumeration and security assessment tool
# Copyright (C) 2008-2014 Jonathan Roach
#
# This program 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 3 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, see <http://www.gnu.org/licenses/>.
#
# Contact: jonnyhightower [at] funkygeek.com
#
##########################################################################
# This is the installer for the Neet modules
export NEET=/opt/neet
export CONFIDR="${NEET}/etc"
export VERSION=`cat VERSION`
export INST="$PWD"
if [ ! -d "$NEET" ]; then
echo "Couldn't find neet installation. Exiting."
exit 1
fi
. ${NEET}/core/installsupport
if [ ! -z $INVOKEDBYNEETUPDATE ] && [ $INVOKEDBYNEETUPDATE -eq 1 ]; then
echo -n " + Installing neet module updates..."
FILESTOREMOVE=""
for file in $FILESTOREMOVE; do
rm -f "$file"
done
#######################################################
mkdir -p "${NEET}/modules/"
mkdir -p "${NEET}/resources/modules/"
# The real modules
cd "${INST}/content"
for module in *; do
if [ -f "${module}/${module}.gsm" ]; then
cd "$module"
# Install the module
cp "${module}.gsm" "${NEET}/modules/"
# Install whatever resources the module needs into the resource directory
auxin=0
for aux in `ls | grep -v .gsm | grep -v install.sh`; do
if [ $auxin -eq 0 ]; then
rm -rf "${NEET}/resources/modules/$module"
mkdir -p "${NEET}/resources/modules/$module" 2>/dev/null
auxin=1
fi
cp -R "$aux" "${NEET}/resources/modules/$module/"
done
# If the module needs special actions (needs config file info, or needs to write somewhere),
# it should have this in its own install.sh script.
if [ -x install.sh ]; then
./install.sh
fi
cd "${INST}/content"
fi
done
# Any templates
cd "${INST}/content"
for module in *; do
if [ -f "${module}/${module}.gsm.temp" ]; then
cd "$module"
# Install the module
cp "${module}.gsm.temp" "${NEET}/modules/"
# Install whatever resources the module needs into the resource directory
auxin=0
for aux in `ls | grep -v .gsm | grep -v install.sh`; do
if [ $auxin -eq 0 ]; then
rm -rf "${NEET}/resources/modules/$module"
mkdir -p "${NEET}/resources/modules/$module" 2>/dev/null
auxin=1
fi
cp -R "$aux" "${NEET}/resources/modules/$module/"
done
# If the module needs special actions (needs config file info, or needs to write somewhere),
# it will have this in its own install.sh script.
if [ -x install.sh ]; then
./install.sh
fi
cd "${INST}/content"
fi
done
#######################################################
newVersion neet-modules $VERSION
echo "done"
else
echo "This package is for the neet-update script and should not be installed manually."
exit 1
fi
exit 0