Check-in [886f20e9b5]
Not logged in

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

Overview

SHA1 Hash:886f20e9b509a4d38204773ddc729d8c391620b9
Date: 2012-05-05 09:29:09
User: BarryK
Comment:/usr/sbin/hostname-set: disconnect from network if hostname changed

Tags And Properties
Changes

Changes to woof-code/rootfs-skeleton/usr/local/petget/help.htm

@@ -71,10 +71,15 @@
 Also note that not all authors of PET packages follow the practice of
 splitting PET packages into these component parts. In some cases there
 may be, for example, 'abiword-1.2.3.pet' which has everything in it. The
 reason that the splitting is usually done is to reduce the size of the
 main EXE package.<br>
+<br>
+As from May 2012, the PPM is enhanced to support EXE,DEV,DOC,NLS
+filtering of Debian and Ubuntu DEB packages. For example,
+'abiword-doc_1.2.3-3build1_all.deb' is recognised as a documentation
+package.<br>
 
       <br>
 
 When you click on one of the packages displayed in the big window,
 another window pops up asking if you really want to install the

Changes to woof-code/rootfs-skeleton/usr/sbin/hostname-set

@@ -6,10 +6,11 @@
 #111103 gcmartin: accept '-' char in hostname.
 #111103 gcmartin: current hostname is $HOSTNAME, but if rerun this script before restarting X, need to get from /etc/hostname.
 #111106 fix passed hostname from connectwizard.
 #111117 shinobar: fix.
 #120227 can also be called from quicksetup. now have exit #
+#120505 when hostname changed, also need to restart network connection. ref: http://www.murga-linux.com/puppy/viewtopic.php?t=77743
 
 export TEXTDOMAIN=hostname-set
 export OUTPUT_CHARSET=UTF-8
 
 #111103 current hostname is $HOSTNAME, but if rerun this script before restarting X, need to get from here...
@@ -51,27 +52,39 @@
 
  NEW_HOSTNAME="`echo -n "$ENTRY_HOSTNAME" | sed -e 's%[^0-9a-zA-Z-]%%g'`" #111103 gcmartin: accept '-' char.
 fi
 
 if [ "$NEW_HOSTNAME" != "$HOSTNAME" ];then
+
+ #120505 when hostname changed, also need to restart network connection...
+ IFCONFIG="`ifconfig | grep '^[pwe]' | grep -v 'wmaster'`"
+ if [ "$IFCONFIG" ];then
+  networkdisconnect #see /usr/sbin
+  M_h3b="
+
+$(gettext '\ZbNOTE:\ZB There did appear to be an active network connection, that has now been disconnected. Restarting the network connection is required to update the hostname on the network. After restarting X, you will have to reconnect -- that can be done by clicking the \Zbconnect\ZB icon on the desktop, or in some cases right-click the \Zbnetwork tray icon\ZB and choose \ZbReconnect\ZB from the menu.')"
+ else
+  M_h3b=""
+ fi
+
  hostname $NEW_HOSTNAME
  echo -n $NEW_HOSTNAME > /etc/hostname
  echo "127.0.0.1 localhost $NEW_HOSTNAME" > /tmp/hostname-set-hosts
  grep -vw 'localhost'  /etc/hosts >> /tmp/hostname-set-hosts
  [ -s /tmp/hostname-set-hosts ] && mv -f /tmp/hostname-set-hosts /etc/hosts
- M_h1=$(gettext 'Set Hostname: done')
- M_h2a=$(gettext 'New hostname')
- M_h2b=$(gettext 'has been set.')
- M_h3=$(gettext 'However, it will not take full effect until after X (the desktop) has been restarted.')
- pupdialog --title "${M_h1}" --msgbox "${M_h2a} '${NEW_HOSTNAME}' ${M_h2b}
-${M_h3}" 0 0
+ M_h1="$(gettext 'Set Hostname: done')"
+ M_h2a="$(gettext 'New hostname')"
+ M_h2b="$(gettext 'has been set.')"
+ M_h3="$(gettext 'However, it will not take full effect until after X (the desktop) has been restarted -- see the \ZbShutdown\ZB entry in the menu.')"
+ pupdialog --colors --title "${M_h1}" --msgbox "${M_h2a} \Zb${NEW_HOSTNAME}\ZB ${M_h2b}
+${M_h3}${M_h3b}" 0 0
  exit 0
 else #111028
- M_h4=$(gettext 'Set Hostname')
- M_h5a=$(gettext 'The hostname is:')
- M_h5b=$(gettext 'You have not changed it.')
- pupdialog --title "${M_h4}" --msgbox "${M_h5a} '${NEW_HOSTNAME}'
+ M_h4="$(gettext 'Set Hostname')"
+ M_h5a="$(gettext 'The hostname is:')"
+ M_h5b="$(gettext 'You have not changed it.')"
+ pupdialog --colors --title "${M_h4}" --msgbox "${M_h5a} \Zb${NEW_HOSTNAME}\ZB
 ${M_h5b}" 0 0
  exit 1
 fi
 
 ###END###