Documentation, remove redundant code, spacing
This commit is contained in:
@ -32,7 +32,6 @@ case $selection in
|
||||
;;
|
||||
4)
|
||||
read -rt 120 -p "What is the maximun number of backups you would like?: " number_of_backups || { echo -e "\nFailed to make a selection in time" ; exit; }
|
||||
backup="true"
|
||||
;;
|
||||
5)
|
||||
restore
|
||||
|
@ -51,7 +51,7 @@ do
|
||||
mapfile -t full_path < <(zfs list | grep "$volume_name" | awk '{print $1}')
|
||||
if [[ "${#full_path[@]}" -gt 1 ]]; then #if there is another app with the same name on another pool, use the current pools application, since the other instance is probably old, or unused, or a backup.
|
||||
echo "$app is using the same volume identifier on more than one pool.. attempting to use your current kubernetes apps pool"
|
||||
pool=$(cli -c 'app kubernetes config' | grep -E "dataset\s\|" | awk -F '|' '{print $3}' | awk -F '/' '{print $1}' | tr -d " \t\n\r")
|
||||
pool=$(cli -c 'app kubernetes config' | grep -E "pool\s\|" | awk -F '|' '{print $3}' | tr -d " \t\n\r")
|
||||
full_path=$(zfs list | grep "$volume_name" | grep "$pool" | awk '{print $1}')
|
||||
fi
|
||||
echo -e "\nMounting\n$full_path\nTo\n/mnt/heavyscript/$data_name"
|
||||
@ -90,7 +90,7 @@ do
|
||||
mapfile -t path < <(find /mnt/*/ix-applications/releases/"$app"/volumes/ -maxdepth 0 | cut -c 6-)
|
||||
if [[ "${#path[@]}" -gt 1 ]]; then #if there is another app with the same name on another pool, use the current pools application, since the other instance is probably old, or unused, or a backup.
|
||||
echo "$i is a name used on more than one pool.. attempting to use your current kubernetes apps pool"
|
||||
pool=$(cli -c 'app kubernetes config' | grep -E "dataset\s\|" | awk -F '|' '{print $3}' | awk -F '/' '{print $1}' | tr -d " \t\n\r")
|
||||
pool=$(cli -c 'app kubernetes config' | grep -E "pool\s\|" | awk -F '|' '{print $3}' | tr -d " \t\n\r")
|
||||
full_path=$(find /mnt/"$pool"/ix-applications/releases/"$app"/volumes/ -maxdepth 0 | cut -c 6-)
|
||||
zfs set mountpoint=legacy "$full_path""$pvc"
|
||||
echo "$i unmounted" && rmdir /mnt/heavyscript/"$i" || echo "failed to unmount $i"
|
||||
|
@ -136,6 +136,8 @@ count=0
|
||||
if [[ $rollback == "true" || "$startstatus" == "STOPPED" ]]; then
|
||||
while true
|
||||
do
|
||||
|
||||
# If app reports ACTIVE right away, assume its a false positive and wait for it to change, or trust it after 5 updates to all_app_status
|
||||
status=$(grep "^$app_name," all_app_status | awk -F ',' '{print $2}')
|
||||
if [[ $count -lt 1 && $status == "ACTIVE" && "$(grep "^$app_name," deploying 2>/dev/null | awk -F ',' '{print $2}')" != "DEPLOYING" ]]; then # If status shows up as Active or Stopped on the first check, verify that. Otherwise it may be a false report..
|
||||
[[ "$verbose" == "true" ]] && echo_array+=("Verifying $status..")
|
||||
@ -152,6 +154,7 @@ if [[ $rollback == "true" || "$startstatus" == "STOPPED" ]]; then
|
||||
done
|
||||
fi
|
||||
(( count++ ))
|
||||
|
||||
if [[ "$status" == "ACTIVE" ]]; then
|
||||
if [[ "$startstatus" == "STOPPED" ]]; then
|
||||
[[ "$verbose" == "true" ]] && echo_array+=("Returing to STOPPED state..")
|
||||
|
Reference in New Issue
Block a user