+ echo "pl_netinit: waiting for flash devices if any to come online"
+ # some usb flash based devices take a couple of seconds to initialize
+ # also, try to read the partition table off the device to make sure
+ # it shows up in /sys/block
+ /bin/sleep 10s
+
+ # make the sd* expansion fail to an empty string if there are no sd
+ # devices
+ shopt -s nullglob
+
+ for device in /sys/block/sd*; do
+ removable=`cat $device/removable`
+ if [[ $removable -ne 1 ]]; then
+ continue
+ fi
+
+ check_dev=/dev/`basename $device`1
+
+ echo "pl_netinit: looking for node configuration file on device $check_dev"
+ /bin/mount -o ro -t $NODE_CONF_DEVICE_FS_TYPES $check_dev \
+ $CONF_DEVICE_MOUNT_POINT 2>&1 > /dev/null
+ if [[ $? -eq 0 ]]; then
+ if [ -r "$CONF_DEVICE_MOUNT_POINT/$NEW_NODE_CONF_NAME" ]; then
+ echo "pl_netinit: found node configuration file plnode.txt, using"
+
+ conf_file="$CONF_DEVICE_MOUNT_POINT/$NEW_NODE_CONF_NAME"
+ /etc/init.d/pl_validateconf < $conf_file > $USED_NET_CONF
+ echo "pl_netinit: found configuration"
+ /bin/umount $CONF_DEVICE_MOUNT_POINT
+ return 1
+ fi
+
+ echo "pl_netinit: not found"
+
+ /bin/umount $CONF_DEVICE_MOUNT_POINT
+ fi
+ done
+
+ # normal filename expansion setting
+ shopt -u nullglob
+
+ # 3. see if there is an old file on the floppy disk. if there was,
+ # the file $TMP_OLD_FLOPPY_CONF_FILE will be readable.
+ if [ -r "$TMP_OLD_FLOPPY_CONF_FILE" ]; then
+ echo "pl_netinit: found node configuration file planet.cnf, using"
+
+ conf_file=$TMP_OLD_FLOPPY_CONF_FILE
+ /etc/init.d/pl_validateconf < $conf_file > $USED_NET_CONF
+ return 1