-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathnadm-gui.sh
30 lines (29 loc) · 926 Bytes
/
nadm-gui.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
#!/bin/bash
# nadm backup & restart
# 11.2.2018 Brandon Pendleton
# Nirmata
PS3='Please enter your choice: '
options=("Backup Nirmata" "Restart Nirmata Agents" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Backup Nirmata")
echo 'Please input the directory in which we want to backup to ie.) /backup/nirmata'
read -r vardirectory
echo The backup will go to "$vardirectory"
set -x
./nadm backup -d "$vardirectory" -n namespace
set +x
;;
"Restart Nirmata Agents")
set -x
kubectl delete pod -n nirmata $(kubectl get pods -n nirmata|grep nirmata-agent |awk '{print $1}')
set +x
echo "You've restarted the Nirmata Agents"
;;
"Quit")
break
;;
*) echo "invalid option $REPLY";;
esac
done