Check-in [a356cc92a7]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

SHA1 Hash:a356cc92a7aafd4230d6b2a2da379ada265c21d2
Date: 2012-02-27 00:04:17
User: BarryK
Comment:new script /usr/sbin/check_internet, called from /usr/sbin/delayedrun

Tags And Properties
Changes

Changes to woof-code/rootfs-skeleton/usr/sbin/check_internet

@@ -1,1 +1,17 @@
+#!/bin/sh
+#(c) Copyright Barry Kauler 2012, license GPL3 (/usr/share/doc/legal)
+#call from: /usr/sbin/delayedrun,
+
+export LANG=C
+
+IFCONFIG="`ifconfig | grep '^[pwe]' | grep -v 'wmaster'`"
+[ ! "$IFCONFIG" ] && exit 1 #no network connection.
+
+ping -c 1 8.8.8.8 #64.233.169.103 #google 111110 address no longer responding.
+[ $? -ne 0 ] && exit 2 #ip address not accessable.
+
+ping -c 1 www.google.com
+[ $? -ne 0 ] && exit 3 #domain name address not accessable.
 
+exit 0 #success
+###END###

Changes to woof-code/rootfs-skeleton/usr/sbin/delayedrun

@@ -38,10 +38,11 @@
 #111110 ping 64.233.169.103 address no longer responding. 01micko: use 8.8.8.8
 #111112 delay a bit more before flashplayer popup.
 #111113 fix for download url for flash player. 111117 fix.
 #120110 added sudo line. see also /etc/sudoers -- set delayedrun does not require password, probably a security hole, need to look at it again later.
 #120201 rodin.s: internationalized.
+#120227 call external /usr/sbin/check_internet
 
 [ "`whoami`" != "root" ] && exec sudo -A ${0} ${@} #120110
 
 export TEXTDOMAIN=delayedrun
 export OUTPUT_CHARSET=UTF-8
@@ -232,83 +233,71 @@
 #101027 install adobe flash player... 110925 fixes, improvements...
 #wait for internet connection, do this only until internet connected 1st time...
 if [ ! -f /var/local/internetsuccess ];then
  if [ ! -f /usr/lib/mozilla/plugins/libflashplayer.so ];then
   while [ 1 ];do
-   #test for valid internet connection...
    sleep 5
-   #ALLPS="`ps`"
-   #if [ "`echo "$ALLPS" | grep -E 'seamonkey|firefox|opera'`" != "" ];then
-   #sleep 2
-   IFCONFIG="`ifconfig | grep '^[pwe]' | grep -v 'wmaster'`"
-   if [ "$IFCONFIG" ];then
-    sleep 5
-    ping -c 1 8.8.8.8 #64.233.169.103 #google 111110 address no longer responding.
+   #test for valid internet connection...
+   check_internet
+   if [ $? -eq 0 ];then
+    sleep 8 #111112 111117
+    touch /var/local/internetsuccess
+    Xdialog --center --title "$(gettext 'Adobe Flash Player')" --icon "/usr/share/doc/flashlogo.gif" --yesno "`gettext \"The Adobe Flash Player for the web browser is not installed.\\nClick the 'OK' button to download and install it (5.2MB).\\nNote, this dialog box only pops up once, so recommend you answer 'OK' now\\n(it can be installed later via the Puppy Package Manager)...\"`" 0 0
     if [ $? -eq 0 ];then
-     sleep 1
-     ping -c 1 www.google.com
+     cd /usr/lib/mozilla/plugins
+     #111113 got download_url from: https://build.opensuse.org/package/view_file?file=update.sh&package=flash-player&project=multimedia%3Aapps&srcmd5=81520f2a67a286b473eca404e348cfb0
+     download_url=$(curl -s 'http://get.adobe.com/flashplayer/completion/?installer=Flash_Player_11_for_other_Linux_(.tar.gz)_32-bit' | egrep  -o 'http:\/\/fpdownload.macromedia.com\/get\/flashplayer\/pdc\/11.*\/install_flash_player_11_linux.i386.tar.gz')
+     #download_file http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz
+     if [ $? -eq 0 -a "$download_url" ];then
+      download_name="`basename $download_url`" #111117
+      download_file $download_url
+     else
+      break
+     fi
      if [ $? -eq 0 ];then
-      sleep 8 #111112 111117
-      touch /var/local/internetsuccess
-       Xdialog --center --title "$(gettext 'Adobe Flash Player')" --icon "/usr/share/doc/flashlogo.gif" --yesno "`gettext \"The Adobe Flash Player for the web browser is not installed.\\nClick the 'OK' button to download and install it (5.2MB).\\nNote, this dialog box only pops up once, so recommend you answer 'OK' now\\n(it can be installed later via the Puppy Package Manager)...\"`" 0 0
+      tar -zxf $download_name #111117 install_flash_player_10_linux.tar.gz
       if [ $? -eq 0 ];then
-       cd /usr/lib/mozilla/plugins
-       #111113 got download_url from: https://build.opensuse.org/package/view_file?file=update.sh&package=flash-player&project=multimedia%3Aapps&srcmd5=81520f2a67a286b473eca404e348cfb0
-       download_url=$(curl -s 'http://get.adobe.com/flashplayer/completion/?installer=Flash_Player_11_for_other_Linux_(.tar.gz)_32-bit' | egrep  -o 'http:\/\/fpdownload.macromedia.com\/get\/flashplayer\/pdc\/11.*\/install_flash_player_11_linux.i386.tar.gz')
-       #download_file http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz
-       if [ $? -eq 0 -a "$download_url" ];then
-        download_name="`basename $download_url`" #111117
-        download_file $download_url
-       else
-        break
-       fi
-       if [ $? -eq 0 ];then
-        tar -zxf $download_name #111117 install_flash_player_10_linux.tar.gz
-        if [ $? -eq 0 ];then
-         #expands with libflashplayer.so at top, 'usr' dir with stuff in it...
-         if [ -d usr ];then
-          cp -a -f usr/* /usr/
-          sync
-          rm -rf usr
-          if [ -f /usr/share/applications/flash-player-properties.desktop ];then
-           #fix it...
-           echo "[Desktop Entry]
+       #expands with libflashplayer.so at top, 'usr' dir with stuff in it...
+       if [ -d usr ];then
+        cp -a -f usr/* /usr/
+        sync
+        rm -rf usr
+        if [ -f /usr/share/applications/flash-player-properties.desktop ];then
+         #fix it...
+         echo "[Desktop Entry]
 Encoding=UTF-8
 Name=$(gettext 'Adobe Flash Player preferences')
 Comment=Preferences for Adobe Flash Player
 Exec=flash-player-properties
 Icon=flash-player-properties.png
 Terminal=false
 Type=Application
 StartupNotify=true
 Categories=Utility" > /usr/share/applications/flash-player-properties.desktop
-           [ ! -e /usr/share/pixmaps/flash-player-properties.png ] && ln -s ../icons/hicolor/16x16/apps/flash-player-properties.png /usr/share/pixmaps/flash-player-properties.png
-          fi
-         fi
+         [ ! -e /usr/share/pixmaps/flash-player-properties.png ] && ln -s ../icons/hicolor/16x16/apps/flash-player-properties.png /usr/share/pixmaps/flash-player-properties.png
         fi
        fi
-       [ -f $download_name ] && rm -f $download_name #111117 install_flash_player_10_linux.tar.gz
-       ldd /usr/lib/mozilla/plugins/libflashplayer.so > /dev/null 2>&1
-       [ $? -ne 0 ] && rm -f /usr/lib/mozilla/plugins/libflashplayer.so 2>/dev/null
-       if [ -f /usr/lib/mozilla/plugins/libflashplayer.so ];then
-        if [ -f /usr/share/applications/flash-player-properties.desktop ];then
-          Xdialog --center --title "$(gettext 'Adobe Flash Player')" --icon "/usr/share/doc/flashlogo.gif" --msgbox "`gettext \"The Adobe Flash Player has been downloaded to:\n /usr/lib/mozilla/plugins/libflashplayer.so\nYou will need to exit from your web browser and restart it for the player to load\n\nNOTICE: This version of Adobe Flash Player has an executable named\n'flash-player-properties' to set preferences. When you close this window,\nthe menu will be updated -- look in the 'Utility' category.\"`" 0 0
-         fixmenus
-         [ "`pidof jwm`" ] && jwm -restart
-        else
-          Xdialog --center --title "$(gettext 'Adobe Flash Player')" --icon "/usr/share/doc/flashlogo.gif" --msgbox "$(gettext 'The Adobe Flash Player has been downloaded to:\\n /usr/lib/mozilla/plugins/libflashplayer.so\\nYou will need to exit from your web browser and restart it for the player to load')" 0 0
-        fi
-       else
-         Xdialog --center --title "$(gettext 'Adobe Flash Player')" --icon "/usr/share/doc/flashlogo.gif" --msgbox "$(gettext 'Sorry, the Player did not download. Try the Puppy Package Manager.')" 0 0
-       fi
+      fi
+     fi
+     [ -f $download_name ] && rm -f $download_name #111117 install_flash_player_10_linux.tar.gz
+     ldd /usr/lib/mozilla/plugins/libflashplayer.so > /dev/null 2>&1
+     [ $? -ne 0 ] && rm -f /usr/lib/mozilla/plugins/libflashplayer.so 2>/dev/null
+     if [ -f /usr/lib/mozilla/plugins/libflashplayer.so ];then
+      if [ -f /usr/share/applications/flash-player-properties.desktop ];then
+       Xdialog --center --title "$(gettext 'Adobe Flash Player')" --icon "/usr/share/doc/flashlogo.gif" --msgbox "`gettext \"The Adobe Flash Player has been downloaded to:\n /usr/lib/mozilla/plugins/libflashplayer.so\nYou will need to exit from your web browser and restart it for the player to load\n\nNOTICE: This version of Adobe Flash Player has an executable named\n'flash-player-properties' to set preferences. When you close this window,\nthe menu will be updated -- look in the 'Utility' category.\"`" 0 0
+       fixmenus
+       [ "`pidof jwm`" ] && jwm -restart
+      else
+       Xdialog --center --title "$(gettext 'Adobe Flash Player')" --icon "/usr/share/doc/flashlogo.gif" --msgbox "$(gettext 'The Adobe Flash Player has been downloaded to:\\n /usr/lib/mozilla/plugins/libflashplayer.so\\nYou will need to exit from your web browser and restart it for the player to load')" 0 0
       fi
-      break
+     else
+      Xdialog --center --title "$(gettext 'Adobe Flash Player')" --icon "/usr/share/doc/flashlogo.gif" --msgbox "$(gettext 'Sorry, the Player did not download. Try the Puppy Package Manager.')" 0 0
      fi
     fi
-   fi
-   #fi
+    break
+   fi
   done
  fi
 fi
 
 touch /tmp/delayedrun_finished_flag #111010
 ###END###