s243a

petget ln#93-92, download if required

Apr 20th, 2018
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.77 KB | None | 0 0
  1. #download if required... #Ln 72 to 92 of /usr/sbin/petget (tahrpup) - https://www.pearltrees.com/s243a/source-petget-usr-sbin/id20395775/item224036322
  2.  
  3. PKGNAME=""
  4. DOWNLOADED=""
  5. if [ "`echo -n "$PASSEDPARAM" | grep -E '^ftp|^http'`" != "" ];then
  6.  cd /root
  7.  #101116 use download_file utility...
  8.  download_file "$PASSEDPARAM"
  9.  PKGPATH="`dirname "$PASSEDPARAM"`" #really a url.
  10.  FULLPKGNAME="`basename "$PASSEDPARAM"`"
  11.  PKGMAIN="`basename "$PASSEDPARAM" ${EXT}`"
  12.  if [ ! -f "$FULLPKGNAME" ];then
  13.   if [ "$DISPLAY"  ]; then
  14.    /usr/lib/gtkdialog/box_ok "$(gettext 'Puppy package manager')" error "$(gettext 'Sorry, failed to download') $FULLPKGNAME"
  15.    exit
  16.   else
  17.    dialog --msgbox "$(gettext 'Sorry, failed to download') $FULLPKGNAME" 0 0
  18.    exit
  19.   fi
  20.  fi
  21.  DOWNLOADED="yes"
Add Comment
Please, Sign In to add comment