mozstart 952 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. #100411 fix for spaces in path/filename.
  3. #Puppy does not want more than one instance of Moz running.
  4. #aug06:
  5. #note, must execute mozilla-bin here, as it is a script with
  6. # a bug fix, and then executes seamonkey-bin.
  7. COMTAIL="$@"
  8. [ "$COMTAIL" = "" ] && exec mozilla #v3.94
  9. URLPREFIX="`echo "$COMTAIL" | grep -E "http://|ftp://|https://|file://|-mail|-edit|-addressbook|-calendar|-remote"`"
  10. if [ "$URLPREFIX" = "" ];then
  11. COMTAIL="`echo -n "$COMTAIL" | sed -e 's/ /%20/g'`"
  12. COMTAIL="file://${COMTAIL}"
  13. else
  14. URLPREFIX="`echo "$COMTAIL" | grep "^file://"`"
  15. [ "$URLPREFIX" ] && COMTAIL="`echo -n "$COMTAIL" | sed -e 's/ /%20/g'`"
  16. fi
  17. ps | grep --extended-regexp 'mozilla\-bin|iceape\-bin' > /dev/null 2>&1
  18. if [ $? -eq 0 ];then #=0 if found.
  19. #exec /usr/lib/mozilla/mozilla-bin -remote "openURL($COMTAIL,new-tab)"
  20. exec mozilla -remote "openURL($COMTAIL,new-tab)"
  21. else
  22. #exec /usr/lib/mozilla/mozilla-bin $COMTAIL
  23. exec mozilla $COMTAIL
  24. fi