forked from muffycompo/radiusdesk-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrd-installer
executable file
·32 lines (29 loc) · 963 Bytes
/
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
#!/bin/bash
# Bash Menu Script Example
clear
echo ""
RD_VERSION="1.2.0"
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: '
options=("[I]nstall/Reconfigure RADIUSDesk" "[Q]uit")
select opt in "${options[@]}"
do
if [[ "$REPLY" == "1" || "$REPLY" == "I" || "$REPLY" == "i" ]]; then
echo "Installing/Reconfiguring RADIUSDesk"
echo ""
$ANSIBLE_EXECUTABLE -i $RD_INSTALLER_PATH/servers $RD_INSTALLER_PATH/rd-installer-ansible.yml
break
elif [[ "$REPLY" == "2" || "$REPLY" == "Q" || "$REPLY" == "q" ]]; then
echo "Quitting RADIUSDesk Installer"
break
else
echo "Invalid Selection...Press any key to try again!"
fi
done