pupdial_wizard_helper 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/sh
  2. #(c) Copyright Barry Kauler September 2010
  3. #License: GPL2 /usr/share/doc/legal
  4. #want to see if a network connection, if so offer to start firewall.
  5. #also, offer to make pupdial the default when click 'connect' icon.
  6. #101017 checkbox to not run this dialog again.
  7. #101026 improve ppp0 active test.
  8. #101206 now called from pupdial after wvdial run.
  9. #120202 BK: internationalized.
  10. #120210 rodin.s: fix typo line 36.
  11. export TEXTDOMAIN=pupdial_wizard_helper
  12. export OUTPUT_CHARSET=UTF-8
  13. DEFAULTCONNECT="`cat /usr/local/bin/defaultconnect | tail -n 1 | tr -s " " | cut -f 2 -d " "`"
  14. [ "$DEFAULTCONNECT" == "pupdial" ] && exit
  15. [ -f /var/local/sns/pupdial_default_noask ] && exit #101017
  16. #101206 test for ppp0 up...
  17. sleep 60 #yep, needs a very big sleep.
  18. [ "`ifconfig | grep '^ppp'`" = "" ] && exit
  19. #dlg to ask (code copied from /usr/local/simple_network_setup/sns)...
  20. MSGFIREWALL=""
  21. CHKFIREWALL=""
  22. if [ ! -f /etc/rc.d/rc.firewall ];then
  23. MSGFIREWALL="<text><label>$(gettext "However, there is one item of recommended housekeeping: you really should be running a firewall. Puppy is inherently secure, however a firewall will give you that extra protection while online. Recommend that you tick the 'Start firewall' checkbox (the firewall will install and will automatically run at all future boots)...")</label></text>"
  24. CHKFIREWALL="<checkbox><label>$(gettext 'Start firewall')</label><default>true</default><variable>CHK_FIREWALL</variable></checkbox>"
  25. fi
  26. export WIN3_DLG="<window title=\"$(gettext 'Wizard: PupDial post-connect')\" icon-name=\"gtk-network\">
  27. <vbox>
  28. <pixmap><input file>/usr/local/lib/X11/pixmaps/ok.xpm</input></pixmap>
  29. <text><label>$(gettext 'It seems that you have successfully dialed the Internet!')</label></text>
  30. ${MSGFIREWALL}
  31. ${CHKFIREWALL}
  32. <text><label>$(gettext "Recommend leave this checkbox ticked, so that Puppy will use PupDial to automatically connect to the Internet at bootup. Also clicking the 'connect' icon on the desktop will immediately launch PupDial...")</label></text>
  33. <checkbox><label>$(gettext 'Set PupDial as default network setup tool')</label><default>true</default><variable>CHK_SNSDEF</variable></checkbox>
  34. <text><label>$(gettext "If you sometimes connect with PupDial, sometimes by other means such as via a LAN or router, and you don't want to set PupDial as the default connection method and you don't want this dialog box to pop up everytime you run PupDial, then leave the above checkbox unticked and tick this box...")</label></text>
  35. <checkbox><label>$(gettext 'Do not display this dialog box again')</label><default>false</default><variable>CHK_NOASK</variable></checkbox>
  36. <hbox>
  37. <button ok></button>
  38. </hbox>
  39. </vbox>
  40. </window>"
  41. RETSTR3="`gtkdialog3 --program=WIN3_DLG --center`"
  42. if [ "`echo "$RETSTR3" | grep '^CHK_SNSDEF' | grep 'true'`" != "" ];then
  43. echo -e '#!/bin/sh\nexec pupdial' > /usr/local/bin/defaultconnect
  44. else
  45. echo -e '#!/bin/sh\nexec connectwizard' > /usr/local/bin/defaultconnect
  46. if [ "`echo "$RETSTR3" | grep '^CHK_NOASK' | grep 'true'`" != "" ];then #101017
  47. echo "true" > /var/local/sns/pupdial_default_noask
  48. fi
  49. fi
  50. if [ "`echo "$RETSTR3" | grep '^CHK_FIREWALL' | grep 'true'`" != "" ];then
  51. rxvt -e firewallinstallshell
  52. fi
  53. ###END###