From 533a8cab39ccf0917bf3f1e88980406de9ef9723 Mon Sep 17 00:00:00 2001 From: drymer Date: Sun, 4 Feb 2018 22:05:09 +0100 Subject: [PATCH] Add and fix functions --- roles/shell-dotfiles/files/functions | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/roles/shell-dotfiles/files/functions b/roles/shell-dotfiles/files/functions index 1b8f179..5e2cb70 100644 --- a/roles/shell-dotfiles/files/functions +++ b/roles/shell-dotfiles/files/functions @@ -19,6 +19,14 @@ function upload_stuff() { done } +# Un bucle infinito facilitado +function always(){ + while true; + do + "$@" + done +} + # Actualiza kubectl function upgrade_kubectl (){ echo "Downloading kubectl..." @@ -33,7 +41,7 @@ function upgrade_kubectl (){ # Actualiza kops function upgrade_kops (){ echo "Downloading kops..." - uri=$(curl -s https://github.com/kubernetes/kops/releases/latest -L | grep "kops-linux-amd64" | grep -v strong | cut -d '"' -f2) + uri=$(curl -s https://github.com/kubernetes/kops/releases/latest -L | grep "kops-linux-amd64" | grep -v strong | cut -d '"' -f2 | head -n1) version=$(echo $uri | cut -d'/' -f6) curl -s -L https://github.com/$uri -o /tmp/kops chmod +x /tmp/kops