diff options
Diffstat (limited to 'etc/init.d')
-rwxr-xr-x | etc/init.d/vyatta-ofr | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/etc/init.d/vyatta-ofr b/etc/init.d/vyatta-ofr index 8ff02ab..87e961f 100755 --- a/etc/init.d/vyatta-ofr +++ b/etc/init.d/vyatta-ofr @@ -12,7 +12,7 @@ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. -# +# # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -66,6 +66,22 @@ have_rl_system () { # if necessary, provide initial config init_bootfile () { + # try floppy + # if we do not discover an fd device, try loading the floppy module + grep -q fd /proc/devices || modprobe -q floppy 2>/dev/null + grep -q ext2 /proc/filesystems || modprobe -q ext2 2>/dev/null + grep -q vfat /proc/filesystems || modprobe -q vfat 2>/dev/null + if [ ! -d /media/floppy/config ] && grep -q fd /proc/devices + then + mkdir -p /media/floppy 2>/dev/null + mount /dev/fd0 /media/floppy -o sync 2>/dev/null || + mount -t ext2 /dev/fd0 /media/floppy -o sync 2>/dev/null || + mount -t vfat /dev/fd0 /media/floppy 2>/dev/null + fi + + [ -d /media/floppy/config ] && + mount -o bind /media/floppy/config /opt/vyatta/etc/config + if [ -f $BOOTFILE ] && grep -q '/\*XORP Configuration File, v1.0\*/' \ $BOOTFILE >&/dev/null; then CURTIME=$(date +%F-%H%M%S) @@ -78,7 +94,7 @@ init_bootfile () { $vyatta_sbindir/vyatta_current_conf_ver.pl > $BOOTFILE fi fi - chgrp ${GROUP} $BOOTFILE + chgrp ${GROUP} $BOOTFILE chmod 660 $BOOTFILE ## remove the unnecessary and potentially conflicting ## config-directory statement (i.e. /mnt/floppy vs. /media/floppy |