-
Notifications
You must be signed in to change notification settings - Fork 27
/
rd-installer
executable file
·47 lines (44 loc) · 1.87 KB
/
rd-installer
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
#!/bin/bash
# Author: Mfawa Alfred Onen <[email protected]>
# Website: http://maomuffy.com
# Bash Menu Script for RADIUSDesk Installer
clear
echo ""
RD_VERSION="1.2.2"
RD_TITLE="==== RADIUSDesk Installer $RD_VERSION ===="
TITLE_BYTES=${#rd_title}
UNDERLINE_STRING=$(for ((i=1; i<=$TITLE_BYTES; i++));do printf "%s" "=";done;printf "\n")
ANSIBLE_EXECUTABLE=$(which ansible-playbook)
RD_INSTALLER_PATH=$(pwd)
# Display Installer Title
echo $RD_TITLE
echo $UNDERLINE_STRING
PS3='Select an Option or [q] to Quit: '
options=("[I]nstall RADIUSDesk" "Install RADIUSDesk + [C]oovaChilli")
select opt in "${options[@]}"
do
if [[ "$REPLY" == "1" || "$REPLY" == "I" || "$REPLY" == "i" ]]; then
echo "Installing RADIUSDesk"
echo ""
$ANSIBLE_EXECUTABLE -i $RD_INSTALLER_PATH/servers $RD_INSTALLER_PATH/rd-installer-ansible.yml
break
elif [[ "$REPLY" == "2" || "$REPLY" == "C" || "$REPLY" == "c" ]]; then
echo "Installing RADIUSDesk + CoovaChilli"
echo ""
read -p "CoovaChilli LAN Interface (default: eth0): " CC_LAN_IF
read -p "CoovaChilli WAN Interface (default: eth1): " CC_WAN_IF
read -sp "CoovaChilli UAM Secret (default: greatsecret): " CC_UAM_SECRET
CC_LAN_IF="${CC_LAN_IF:=eth0}"
CC_WAN_IF="${CC_WAN_IF:=eth1}"
CC_UAM_SECRET="${CC_UAM_SECRET:=greatsecret}"
echo ""
echo "$CC_LAN_IF - $CC_WAN_IF - $CC_UAM_SECRET"
$ANSIBLE_EXECUTABLE -i $RD_INSTALLER_PATH/servers $RD_INSTALLER_PATH/rd-installer-ansible.yml --extra-vars "enable_coovachilli_support=yes coovachilli_lan_if=$CC_LAN_IF coovachilli_wan_if=$CC_WAN_IF coovachilli_uam_secret=$CC_UAM_SECRET"
break
elif [[ "$REPLY" == "3" || "$REPLY" == "Q" || "$REPLY" == "q" ]]; then
echo "Quitting RADIUSDesk Installer"
break
else
echo "Invalid Selection...Press any key to try again!"
fi
done