forked from boypt/openssh-rpms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpullsrc.sh
executable file
·56 lines (45 loc) · 1.86 KB
/
pullsrc.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
#!/usr/bin/env bash
# Bash3 Boilerplate. Copyright (c) 2014, kvz.io
set -o errexit
set -o pipefail
set -o nounset
# set -o xtrace
trap 'echo -e "Aborted, error $? in command: $BASH_COMMAND"; trap ERR; exit 1' ERR
# Set magic variables for current file & dir
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
__base="$(basename ${__file} .sh)"
__root="$(cd "$(dirname "${__dir}")" && pwd)" # <-- change this as it depends on your app
arg1="${1:-}"
# trap 'echo Signal caught, cleaning up >&2; cd /tmp; /bin/rm -rfv "$TMP"; exit 15' 1 2 3 15
# allow command fail:
# fail_command || true
source version.env
OPENSSHMIR=https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable
OPENSSLMIR=https://www.openssl.org/source/
OPENSSLMIR=https://github.com/openssl/openssl/releases/download/openssl-${OPENSSLVER}/
ASKPASSMIR=https://src.fedoraproject.org/repo/pkgs/openssh/x11-ssh-askpass-1.2.4.1.tar.gz/8f2e41f3f7eaa8543a2440454637f3c3
PERLMIR=https://www.cpan.org/src/5.0
rpm -q wget >/dev/null || yum install -y wget
mkdir -p downloads
pushd downloads
if [[ ! -f $OPENSSLSRC ]]; then
echo "Get:" $OPENSSLMIR/$OPENSSLSRC
wget --no-check-certificate $OPENSSLMIR/$OPENSSLSRC || \
echo "!!! Please download $OPENSSLSRC in $PWD by yourself."
fi
if [[ ! -f $OPENSSHSRC ]]; then
echo Get: $OPENSSHMIR/$OPENSSHSRC
wget --no-check-certificate $OPENSSHMIR/$OPENSSHSRC || \
echo "!!! Please download $OPENSSHSRC in $PWD by yourself."
fi
if [[ ! -f $ASKPASSSRC ]]; then
echo Get: $ASKPASSMIR/$ASKPASSSRC
wget --no-check-certificate $ASKPASSMIR/$ASKPASSSRC || \
echo "!!! Please download $ASKPASSSRC in $PWD by yourself."
fi
if [[ $($__dir/compile.sh GETEL) == "el5" && ! -f $PERLSRC ]]; then
echo Get: $PERLMIR/$PERLSRC
wget --no-check-certificate $PERLMIR/$PERLSRC || \
echo "!!! Please download $PERLSRC in $PWD by yourself."
fi