From 77ab47a9849bb0491e30bd437cf112791098836b Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Fri, 3 Mar 2017 22:34:55 -0800 Subject: [PATCH] Awk for perl Signed-off-by: Dan Schaper --- advanced/Scripts/version.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/advanced/Scripts/version.sh b/advanced/Scripts/version.sh index edcb8958..d930b8a2 100755 --- a/advanced/Scripts/version.sh +++ b/advanced/Scripts/version.sh @@ -66,23 +66,23 @@ getLocalWebVersion(){ } PHVERSIONLATEST=$(curl -s https://api.github.com/repos/pi-hole/pi-hole/releases/latest | \ - grep -Po '"tag_name":.*?[^\\]",' | \ - perl -pe 's/"tag_name": "//; s/^"//; s/",$//') + awk -F: '$1 ~/tag_name/ { print $2 }' | \ + tr -cd '[[:alnum:]]._-') WEBVERSIONLATEST=$(curl -s https://api.github.com/repos/pi-hole/AdminLTE/releases/latest | \ - grep -Po '"tag_name":.*?[^\\]",' | \ - perl -pe 's/"tag_name": "//; s/^"//; s/",$//') + awk -F: '$1 ~/tag_name/ { print $2 }' | \ + tr -cd '[[:alnum:]]._-') -PHHASHLATEST=$(curl -s https://api.github.com/repos/pi-hole/pi-hole/commits/master | \ - grep sha | \ - head -n1 | \ - awk -F ' ' '{ print $2}' | \ - tr -cd '[[:alnum:]]._-') +#PHHASHLATEST=$(curl -s https://api.github.com/repos/pi-hole/pi-hole/commits/master | \ +# grep sha | \ +# head -n1 | \ +# awk -F ' ' '{ print $2 }' | \ +# tr -cd '[[:alnum:]]._-') -WEBHASHLATEST=$(curl -s https://api.github.com/repos/pi-hole/AdminLTE/commits/master | \ - grep sha | \ - head -n1 | \ - awk -F ' ' '{ print $2}' | \ - tr -cd '[[:alnum:]]._-') +#WEBHASHLATEST=$(curl -s https://api.github.com/repos/pi-hole/AdminLTE/commits/master | \ +# grep sha | \ +# head -n1 | \ +# awk -F ' ' '{ print $2 }' | \ +# tr -cd '[[:alnum:]]._-') normalOutput() {