-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
fsget.sh
executable file
·95 lines (79 loc) · 3.6 KB
/
fsget.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
#!/bin/bash
TOKEN=$1
RELEASE=$2
INSTALL=$3
# Source the os-release file (assuming it exists)
. /etc/os-release
echo $ID
echo $VERSION_CODENAME
if [ "${ID,,}" = "debian" ]; then
ARCH=$(dpkg --print-architecture)
if [[ "${TOKEN}" == pat_* ]]; then
echo "FreeSWITCH Community"
RPI=""
if [ "${RELEASE,,}" = "prerelease" ]; then
RELEASE="unstable"
else
RELEASE="release"
fi
echo $RELEASE
if [ "${ARCH,,}" = "armhf" ]; then
RPI="rpi/"
fi
rm -f /etc/apt/sources.list.d/freeswitch.list
apt-get update && apt-get install -y gnupg2 wget software-properties-common apt-transport-https
wget --http-user=signalwire --http-password=$TOKEN -O /usr/share/keyrings/signalwire-freeswitch-repo.gpg https://freeswitch.signalwire.com/repo/deb/${RPI}debian-release/signalwire-freeswitch-repo.gpg
echo "machine freeswitch.signalwire.com login signalwire password $TOKEN" > /etc/apt/auth.conf
chmod 600 /etc/apt/auth.conf
echo "deb [signed-by=/usr/share/keyrings/signalwire-freeswitch-repo.gpg] https://freeswitch.signalwire.com/repo/deb/${RPI}debian-${RELEASE}/ ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/freeswitch.list
echo "deb-src [signed-by=/usr/share/keyrings/signalwire-freeswitch-repo.gpg] https://freeswitch.signalwire.com/repo/deb/${RPI}debian-${RELEASE}/ ${VERSION_CODENAME} main" >> /etc/apt/sources.list.d/freeswitch.list
apt-get update
if [ "${INSTALL}" = "install" ]; then
echo "Installing FreeSWITCH Community"
apt-get install -y freeswitch-meta-all
echo "------------------------------------------------------------------"
echo " Done installing FreeSWITCH Community"
echo "------------------------------------------------------------------"
else
echo "------------------------------------------------------------------"
echo " Done configuring FreeSWITCH Debian repository"
echo "------------------------------------------------------------------"
echo "To install FreeSWITCH Community type: apt-get install -y freeswitch-meta-all"
fi
elif [[ "${TOKEN}" == PT* ]]; then
echo "FreeSWITCH Enterprise"
if [ "${RELEASE,,}" = "prerelease" ]; then
RELEASE="unstable"
else
RELEASE="1.8"
fi
echo $RELEASE
if [ "${ARCH,,}" = "armhf" ]; then
RPI="-rpi"
fi
rm -f /etc/apt/sources.list.d/freeswitch.list
apt-get update && apt-get install -y gnupg2 wget software-properties-common apt-transport-https
wget --http-user=signalwire --http-password=$TOKEN -O - https://fsa.freeswitch.com/repo/deb/fsa${RPI}/pubkey.gpg | apt-key add -
echo "machine fsa.freeswitch.com login signalwire password $TOKEN" > /etc/apt/auth.conf
chmod 600 /etc/apt/auth.conf
echo "deb https://fsa.freeswitch.com/repo/deb/fsa${RPI}/ ${VERSION_CODENAME} ${RELEASE}" > /etc/apt/sources.list.d/freeswitch.list
echo "deb-src https://fsa.freeswitch.com/repo/deb/fsa${RPI}/ ${VERSION_CODENAME} ${RELEASE}" >> /etc/apt/sources.list.d/freeswitch.list
apt-get update
if [ "${INSTALL}" = "install" ]; then
echo "Installing FreeSWITCH Enterprise"
apt-get install -y freeswitch-meta-all
echo "------------------------------------------------------------------"
echo " Done installing FreeSWITCH Enterprise"
echo "------------------------------------------------------------------"
else
echo "------------------------------------------------------------------"
echo " Done configuring FreeSWITCH Debian repository"
echo "------------------------------------------------------------------"
echo "To install FreeSWITCH Enterprise type: apt-get install -y freeswitch-meta-all"
fi
else
echo "Unrecognized token type"
fi
else
echo "Unrecognized OS. We support Debian only."
fi