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