-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·36 lines (29 loc) · 833 Bytes
/
install.sh
File metadata and controls
executable file
·36 lines (29 loc) · 833 Bytes
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
#!/bin/sh -ex
ORG=locochris
PKG=syscheck
VERSION=0.0.13
DEPENDENCIES=shpec/shpec:0.1.0
TMPDIR=${TMPDIR:-/tmp}
install_dependencies() {
for dependency_and_version in $@; do
dependency=`echo $dependency_and_version|cut -d: -f1`
version=`echo $dependency_and_version|cut -d: -f2`
if ! command -v shpec >/dev/null 2>&1 || [ `shpec --version` != $version ]; then
sh -c "`curl --silent --location https://raw.githubusercontent.com/$dependency/master/install.sh`"
fi
done
}
install_pkg() {
org=${1:-$ORG}
pkg=${2:-$PKG}
version=${3:-$VERSION}
pkgdir=${TMPDIR}/${pkg}-${version}
cd $TMPDIR
curl -sL https://github.com/${org}/${pkg}/archive/${version}.tar.gz | tar zxf -
cd $pkgdir
make install
cd $TMPDIR
rm -rf $PKGDIR
}
install_dependencies $DEPENDENCIES
install_pkg $ORG $PKG $VERSION