Advertisement
s243a

PortableBrowserInstall

Jun 15th, 2019
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.87 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. #Selector for portable web browsers, copied from © Mike Walsh Apr 2018
  4. #
  5.  
  6. #/usr/local/PortableBrowserInstaller/yad_dnld.sh
  7.  
  8. #https://unix.stackexchange.com/questions/145651/using-exec-and-tee-to-redirect-logs-to-stdout-and-a-log-file-in-the-same-time
  9. #logfile=/var/log/PortableBrowserInstall.log
  10. #[-e "$logfile" ] && rm"$logfile"
  11. #exec &> >(tee -a "$logfile" )
  12.  
  13. if [ ! -z "`which yad`" ]; then
  14.  
  15. yad --center --window-icon=/usr/local/lib/X11/pixmaps/www48.png --title="Portable Web Browser Installer" --form --width=450 --text="PORTABLE WEB BROWSER INSTALLER
  16. --------------------------------------------------
  17. Please choose your desired browser:" \
  18. --image="/usr/local/lib/X11/pixmaps/www48.png" \
  19. --field="Firefox Quantum":fbtn "ffinst" \
  20. --field="Palemoon":fbtn "pminst" \
  21. --field="Seamonkey":fbtn "sminst" \
  22. --field="Thunderbird email client":fbtn "tbinst" \
  23. --no-buttons --close-on-unfocus
  24.  
  25. else
  26.   #tty -s; if [ $? -ne 0 ]; then defaultterminal -hold -e "$0"; exit; fi
  27.   bla=$(basename `tty`) && exit_status=0 || exit_status=1
  28.   #exit_status=$?
  29.   [ $bla -eq $bla ] 2>/dev/null && not_a_num=0 || not_a_num=1
  30.   echo "not_a_num=$not_a_num">2
  31.   echo "exit_status=$exit_status">2
  32.   echo "bla=$bla" >2
  33.   if [ $exit_status -ne 0 ] ||
  34.      [ $not_a_num -eq 1 ] ||
  35.      [ $bla -eq 0 ]; then
  36.     defaultterminal -hold -e "$0"
  37.   fi
  38.   tempfile=/tmp/bla
  39.   dialog --backtitle "CPU Selection" \
  40.   --ok-label "OK" \
  41.   --radiolist "Please spacebar to select your desired browser:" 10 40 4 \
  42.         1 "Firefox Quantum" off \
  43.         2 "Palemoon" on \
  44.         3 "Seamonkey" off \
  45.         4 "Thunderbird email client" off \
  46.         2> $tempfile
  47.   is_ok="$?"
  48.   browser_choice=`cat $tempfile`
  49.   echo browser_choice
  50.   if [ $is_ok -eq 0 ]; then
  51.     case "$browser_choice" in
  52.     1) ffinst ;;
  53.     2) pminst ;;
  54.     3) sminst ;;
  55.     4) tbinst ;;
  56.     esac
  57.   fi
  58. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement