-
Notifications
You must be signed in to change notification settings - Fork 1
/
tool-generate-urls.sh
executable file
·48 lines (36 loc) · 1.18 KB
/
tool-generate-urls.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
#!/bin/bash
set -e
defaultRoomName="Video Visit Room 0"
read -p "Enter video room Name (default ${defaultRoomName}): " roomName
if [[ -z ${roomName} ]]; then
roomName=${defaultRoomName}
fi
defaultProviderName="Dr X"
read -p "Enter provider's display Name (default ${defaultProviderName}): " providerName
if [[ -z ${providerName} ]]; then
providerName=${defaultProviderName}
fi
defaultPatientName="Jane"
read -p "Enter patient's display Name (default ${defaultPatientName}): " patientName
if [[ -z ${patientName} ]]; then
patientName=${defaultPatientName}
fi
url=$(twilio rtc:apps:video:view | grep 'Web App URL' | sed -e 's/Web App URL: //')
echo "url: ${url}"
host=${url%\?*}
echo "host: ${host}"
passcode=${url#*\?}
echo "passcode: ${passcode}"
roomName=${roomName// /%20}
providerName=${providerName// /%20}
patientName=${patientName// /%20}
echo
echo "provider link:"
echo "${host}/?room=${roomName}&persona=provider&name=${providerName}&${passcode}"
echo
echo "sample patient link:"
echo "${host}/?room=${roomName}&persona=patient&name=${patientName}&${passcode}"
echo
echo "sample 3rd party link:"
echo "${host}/?room=${roomName}&persona=thirdparty&name=Uncle%20Frank&${passcode}"
echo