diff options
Diffstat (limited to 'etc')
-rw-r--r-- | etc/bash_completion.d/20vyatta-cfg | 12 | ||||
-rwxr-xr-x | etc/init.d/vyatta-ofr | 71 |
2 files changed, 13 insertions, 70 deletions
diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/20vyatta-cfg index 78f2e0a..bc9088f 100644 --- a/etc/bash_completion.d/20vyatta-cfg +++ b/etc/bash_completion.d/20vyatta-cfg @@ -941,12 +941,18 @@ make_vyatta_config_dir () sudo chgrp ${DEF_GROUP} $1 } +if grep -q union=aufs /proc/cmdline || grep -q aufs /proc/filesystems ; then + export UNIONFS=aufs +else + export UNIONFS=unionfs +fi + make_vyatta_config_dir $VYATTA_ACTIVE_CONFIGURATION_DIR make_vyatta_config_dir $VYATTA_CHANGES_ONLY_DIR make_vyatta_config_dir $VYATTA_CONFIG_TMP if [ ! -d $VYATTA_TEMP_CONFIG_DIR ]; then make_vyatta_config_dir $VYATTA_TEMP_CONFIG_DIR - sudo mount -t unionfs -o dirs=${VYATTA_CHANGES_ONLY_DIR}=rw:/opt/vyatta/config/active=ro unionfs ${VYATTA_TEMP_CONFIG_DIR} + sudo mount -t $UNIONFS -o dirs=${VYATTA_CHANGES_ONLY_DIR}=rw:/opt/vyatta/config/active=ro $UNIONFS ${VYATTA_TEMP_CONFIG_DIR} fi # disallow 'Ctrl-D' exit, since we need special actions on 'exit' @@ -976,3 +982,7 @@ complete -F vyatta_config_complete edit complete -F vyatta_config_complete exit complete -F vyatta_run_complete run +# Local Variables: +# mode: shell-script +# sh-indentation: 4 +# End: diff --git a/etc/init.d/vyatta-ofr b/etc/init.d/vyatta-ofr index 96770f6..aaa31b2 100755 --- a/etc/init.d/vyatta-ofr +++ b/etc/init.d/vyatta-ofr @@ -69,53 +69,6 @@ have_rl_system () { test -x $vyatta_sbindir/rl-system.init } -use_floppy () { - _fd_=/media/floppy - - if have_rl_system ; then -## only do this if we have the rl-system package -## if we donot discover an fd device, try loading the floppy module - grep -q fd /proc/devices || modprobe -q floppy 2>/dev/null - if grep -q fd /proc/devices ; then - if awk -- '$1 ~ /\/dev\/fd/ { exit 1 }' /proc/mounts - then - mkdir -p $_fd_ - mount -t ext2 /dev/fd0 $_fd_ -o sync 2>/dev/null - test $? -eq 32 && mount -t vfat /dev/fd0 $_fd_ 2>/dev/null - fi - fi - fi - test -d ${_fd_}/config -} - -setup_configdir() { - [ -f $BOOTFILE ] && return 0 - mkdir -m 0775 -p ${vyatta_sysconfdir}/config - chgrp ${GROUP} ${vyatta_sysconfdir}/config - if [ -d ~root/vyatta/config ] ; then - mount -o bind ~root/vyatta/config $vyatta_sysconfdir/config - elif use_floppy ; then - mount -o bind /media/floppy/config $vyatta_sysconfdir/config - else - mkdir -m 0775 -p ~root/vyatta/config - chgrp ${GROUP} ~root/vyatta ~root/vyatta/config - mount -o bind ~root/vyatta/config $vyatta_sysconfdir/config - fi -} - -setup_rclocal () { - [ -f /etc/rc.local ] || touch /etc/rc.local - if [ -f ~root/vyatta/rc.local ]; then - mount -o bind ~root/vyatta/rc.local /etc/rc.local - elif [ -f /media/floppy/rc.local ]; then - mount -o bind /media/floppy/rc.local /etc/rc.local - fi -} - -restore_rclocal () { - umount /etc/rc.local >& /dev/null -} - # if necessary, provide initial config init_bootfile () { if [ ! -f $BOOTFILE ] ; then @@ -150,28 +103,10 @@ load_bootfile () fi } -# this handles the "config dir" (/opt/vyatta/config), which is different -# from the directory for config files (/opt/vyatta/etc/config). -mount_cfg_dir () -{ - if [ ! -d ${vyatta_configdir} ] ; then - mkdir -m 0775 -p ${vyatta_configdir} - chgrp ${GROUP} ${vyatta_configdir} - fi - mount -o nosuid,nodev -t tmpfs none ${vyatta_configdir} -} - -unmount_cfg_dir () -{ - umount ${vyatta_configdir} -} - start () { log_daemon_msg "Starting Vyatta Router" - setup_configdir - setup_rclocal - mount_cfg_dir + mount -o nosuid,nodev -t tmpfs none ${vyatta_configdir} init_bootfile migrate_bootfile for s in ${subinit[@]} ; do @@ -179,7 +114,6 @@ start () ${vyatta_sbindir}/${s}.init start || (log_end_msg $? && return) done load_bootfile - echo -n $BOOTFILE > ${vyatta_sysconfdir}/bootfile_path log_end_msg $? } @@ -193,8 +127,7 @@ stop() ${vyatta_sbindir}/${s}.init stop let status\|=$? done - unmount_cfg_dir - restore_rclocal + umount ${vyatta_configdir} log_end_msg $status } |