Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- #Selector for portable web browsers, copied from © Mike Walsh Apr 2018
- #
- #/usr/local/PortableBrowserInstaller/yad_dnld.sh
- #https://unix.stackexchange.com/questions/145651/using-exec-and-tee-to-redirect-logs-to-stdout-and-a-log-file-in-the-same-time
- #logfile=/var/log/PortableBrowserInstall.log
- #[-e "$logfile" ] && rm"$logfile"
- #exec &> >(tee -a "$logfile" )
- if [ ! -z "`which yad`" ]; then
- yad --center --window-icon=/usr/local/lib/X11/pixmaps/www48.png --title="Portable Web Browser Installer" --form --width=450 --text="PORTABLE WEB BROWSER INSTALLER
- --------------------------------------------------
- Please choose your desired browser:" \
- --image="/usr/local/lib/X11/pixmaps/www48.png" \
- --field="Firefox Quantum":fbtn "ffinst" \
- --field="Palemoon":fbtn "pminst" \
- --field="Seamonkey":fbtn "sminst" \
- --field="Thunderbird email client":fbtn "tbinst" \
- --no-buttons --close-on-unfocus
- else
- #tty -s; if [ $? -ne 0 ]; then defaultterminal -hold -e "$0"; exit; fi
- bla=$(basename `tty`) && exit_status=0 || exit_status=1
- #exit_status=$?
- [ $bla -eq $bla ] 2>/dev/null && not_a_num=0 || not_a_num=1
- echo "not_a_num=$not_a_num">2
- echo "exit_status=$exit_status">2
- echo "bla=$bla" >2
- if [ $exit_status -ne 0 ] ||
- [ $not_a_num -eq 1 ] ||
- [ $bla -eq 0 ]; then
- defaultterminal -hold -e "$0"
- fi
- tempfile=/tmp/bla
- dialog --backtitle "CPU Selection" \
- --ok-label "OK" \
- --radiolist "Please spacebar to select your desired browser:" 10 40 4 \
- 1 "Firefox Quantum" off \
- 2 "Palemoon" on \
- 3 "Seamonkey" off \
- 4 "Thunderbird email client" off \
- 2> $tempfile
- is_ok="$?"
- browser_choice=`cat $tempfile`
- echo browser_choice
- if [ $is_ok -eq 0 ]; then
- case "$browser_choice" in
- 1) ffinst ;;
- 2) pminst ;;
- 3) sminst ;;
- 4) tbinst ;;
- esac
- fi
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement