-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhep_cli_installer.sh
61 lines (53 loc) · 1.98 KB
/
hep_cli_installer.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
#!/bin/bash
GREEN='\033[0;32m'
NC='\033[0m'
if [ -n "$(command -v yum)" ];then
echo
cat > /etc/yum.repos.d/qxip_hepic.repo << 'EOF'
[qxip_hepic]
name=qxip_hepic
baseurl=https://0000-0000-0000-rpm:@packagecloud.io/qxip/hepic/rpm_any/rpm_any/$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://0000-0000-0000-rpm:@packagecloud.io/qxip/hepic/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
[qxip_hepic-source]
name=qxip_hepic-source
baseurl=https://0000-0000-0000-rpm:@packagecloud.io/qxip/hepic/rpm_any/rpm_any/SRPMS
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://0000-0000-0000-rpm:@packagecloud.io/qxip/hepic/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
EOF
yum install -y sudo curl
echo -e "Please insert the provided key to install hep_cli:"
read key
sed -i "s/0000-0000-0000-rpm/$key/g" /etc/yum.repos.d/qxip_hepic.repo
echo -e "************************************************************"
echo -e "\t ${GREEN} Installing Hepic-Installer a.k.a hep_cli ${NC}\n\t\t"
echo -e "************************************************************"
yum install -y hepic-installer
elif [ -n "$(command -v apt-get)" ];then
apt-get install -y sudo gnupg curl
cat > /etc/apt/sources.list.d/qxip_hepic.list << 'EOF'
deb https://0000-0000-0000-deb:@packagecloud.io/qxip/hepic/any/ any main
deb-src https://0000-0000-0000-deb:@packagecloud.io/qxip/hepic/any/ any main
EOF
echo -e "Please insert the provided key to install hep_cli:"
read key
curl -L https://$key:@packagecloud.io/qxip/hepic/gpgkey | apt-key add -
sed -i "s/0000-0000-0000-deb/$key/g" /etc/apt/sources.list.d/qxip_hepic.list
echo -n "Running apt-get update... "
apt-get update &> /dev/null
echo "done."
echo -e "************************************************************"
echo -e "\t ${GREEN} Installing Hepic-Installer a.k.a hep_cli ${NC}\n\t\t"
echo -e "************************************************************"
apt-get install -y hepic-installer
fi