From 34e4e9fee73f93de3a12d617255db08f252ec461 Mon Sep 17 00:00:00 2001 From: Mickael-Martin Date: Thu, 17 Jan 2019 13:22:53 +0100 Subject: [PATCH] Update upgrade --- scripts/upgrade | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 46324eb..9f195e2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -74,14 +74,11 @@ curl -s --cookie cookiejar.txt --cookie-jar cookiejar.txt \ --form "enter=Sign+in" \ --form "name=Admin" \ --form "password=zabbix" \ - "$zabbixFullpath/index.php" + "${zabbixFullpath}index.php" sid=$(curl -s --cookie cookiejar.txt --cookie-jar cookiejar.txt \ - "$zabbixFullpath/conf.import.php" \ - |grep sid |head -n 1 \ - |awk -Fsid= '{print $2}' \ - |awk -F\" '{print $1}' \ - |cut -c -16 ) + "${zabbixFullpath}/import.php" \ + | grep -Po 'name="sid" value="\K([a-z0-9]{16})(?=")' ) curl -s --cookie cookiejar.txt --cookie-jar cookiejar.txt \ --form "config=1" \ @@ -108,7 +105,7 @@ curl -s --cookie cookiejar.txt --cookie-jar cookiejar.txt \ --form "backurl=templates.php" \ --form "form_refresh=1" \ --form "sid=${sid}" \ \ - 'https://$zabbixFullpath/conf.import.php?rules_preset=template' + 'https://${zabbixFullpath}conf.import.php?rules_preset=template' #================================================= # Disable default admin for security issue