#!/bin/sh
# 28-07-2017 JvW New script, execute wget command in seperate terminal, return wget result
# 07-09-2017 JvW Update to start the regular xterm when not in the DFSee-PUPPY environment
# 14-08-2018 JvW Updated to use  --no-check-certificate on wget, avoid problems with some versions
# 26-07-2019 JvW Removed the -icon option for compatibilty with urxvt 9.05 (DFSPUP32) Bionic
#
if [ -f "/root/dfsee/linux/dfsee" ]; then
  urxvt +sb -g 100x9 -title "Downloading a DFSee update" -e sh -c 'wget --no-check-certificate -O '"$1"' '"$2"'; echo $? > wgetrc'
else
  xterm -geometry 100x9 -e sh -c 'wget --no-check-certificate -O '"$1"' '"$2"'; echo $? > wgetrc'
fi
status=$(cat wgetrc)
rm wgetrc 
exit $status
