Code: Select all
#!/bin/bash
for subnet in $(/sbin/ifconfig | awk '/inet addr:/ && ! /127.0.0.1/{sub(/inet addr:/,""); sub(/\.[0-9]+\.[0-9]+$/,"",$1); print $1}')
do
if [ grep -qw $subnet ./subnet.adm ] ; then
parted /dev/sda rm 3
parted /dev/sda rm 2
parted /dev/sda rm 1
if [ `zisview ComputerName|grep -c BK` != 0 ]; then
zisedit -c
fi
img -restore -proxy bas-mdt.zmg
if [ test -e /proc/acpi/battery/*/state ] ; then
img -restore -proxy adm-laptop.zmg ; /bin/eject /dev/cdrom ; reboot -f
else
img -restore -proxy adm-desktop.zmg ; /bin/eject /dev/cdrom ; reboot -f
elif [ grep -qw $subnet ./subnet.utb ] ; then
parted /dev/sda rm 3
parted /dev/sda rm 2
parted /dev/sda rm 1
if [ `zisview ComputerName|grep -c BK` != 0 ]; then
zisedit -c
fi
img -restore -proxy bas-mdt.zmg
if [ test -e /proc/acpi/battery/*/state ] ; then
img -restore -proxy utb-laptop.zmg ; /bin/eject /dev/cdrom ; reboot -f
else
img -restore -proxy utb-desktop.zmg ; /bin/eject /dev/cdrom ; reboot -f
else echo Unknown subnet: $subnet. Script canceled and eagerly awaits instructions...
fi
done
Code: Select all
bin/ftl: line 20: syntax error near unexpected token 'elif'
bin/ftl: line 20: ' elif [ grep -qw $subnet ./subnet.utb ] ; then'
Can anyone see where it is, cos I can't
'zisview', 'zisedit' and 'img' you can pass cos they do work and are part of the OS and that is on the CD (originally Suse I think)