It's just to fix the save-config script, because the "Configuration
saved" message appears even if the configuration hasn't been saved.
Here is the improoved script (note the last 'if' at the end)
/bin/save-config
#!/bin/bash
# save the current configuration (/etc) to the floppy disc
echo "Saving current configuration"
until [ -e /floppy/etc.tar.gz ] ; do
if mount -t vfat /dev/fd0 /floppy 2>&1 >/dev/null ; then
if [ -e /floppy/etc.tar.gz ] ; then
continue
else
umount /floppy
fi
fi
beep;beep;
echo "Please insert Configuration Floppy"
sleep 2
done
tar -czf /floppy/etc.tar.gz \
--exclude=*~ \
--exclude=mtab \
--exclude=*.2.old \
--exclude=*.3.old \
--exclude=*.4.old \
--exclude=*.5.old \
--exclude=*.6.old \
--exclude=*.7.old \
--exclude=*.8.old \
--exclude=*.9.old \
--exclude=dhcpcd-eth*.pid \
/etc /root
error=$?
umount /floppy
if [ $error -eq 141 ]; then
echo "Floppy protected, configuration not saved"
else
echo "Configuration saved"
fi
|