From 27929419890f90e42556b55fd70f7d4607a16aa5 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Fri, 29 May 2015 18:27:59 +0200 Subject: [PATCH] Added auto-update --- learn.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/learn.sh b/learn.sh index b2ef100..5aeecd1 100644 --- a/learn.sh +++ b/learn.sh @@ -5,6 +5,17 @@ # Thanks to The Linux Documentation Project and to #openshells @freenode. # 1.0 +which wget &>/dev/null +if [ "$?" = 0 ];then dl() { +wget $1 -O $2 $3 + } + Q="-q" +else dl() { +curl $1 -o $2 $3 + } + Q="-s" +fi + echo -n "Self-updating script..." && dl http://daniilgentili.magix.net/learn.sh $0 $Q 2>/dev/null;chmod +x $0 &>/dev/null; echo -en "\r\033[K" clear