#!/bin/sh
#120225 renamed this script from basichtmlview to basichtmlviewer. added surfer.
#120512 have renamed executable in helpsurfer pkg (latest pet).
#150209 surfer: the empty double-quotes causes crash.

if [ -d /usr/local/PuppyBrowser ];then
 export MOZ_DISABLE_PANGO=1
 #grab these from SeaMonkey...
 [ ! -f /root/.PuppyBrowser/default/cert8.db ] && /usr/local/PuppyBrowser/find_certs &
 cd /usr/local/PuppyBrowser
 exec ./PuppyBrowser "$@" -title="Puppy HTML Viewer" -w=798 -h=580 -profile=helpviewer
fi

#120512 have renamed executable in helpsurfer pkg (latest pet)...
if [ -f /usr/bin/helpsurfer ];then #package helpsurfer
 COMMANDPARAM="`echo -n "$@" | sed -e 's%file://%%'`" #surfer cannot handle this.
 if [ "$COMMANDPARAM" ];then
  exec helpsurfer "$COMMANDPARAM"
 else
  exec helpsurfer #150209 the empty double-quotes causes crash.
 fi
fi

if [ -f /usr/bin/surfer ];then #package helpsurfer
 COMMANDPARAM="`echo -n "$@" | sed -e 's%file://%%'`" #surfer cannot handle this.
 if [ "$COMMANDPARAM" ];then
  exec surfer "$COMMANDPARAM"
 else
  exec surfer #150209 the empty double-quotes causes crash.
 fi
fi

exec defaulthtmlviewer "$@"
