diff options
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/bash_completion.d/20vyatta-cfg | 22 | ||||
-rw-r--r-- | etc/shell/level/users/allowed-op | 1 |
2 files changed, 23 insertions, 0 deletions
diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/20vyatta-cfg index c7e9ed7..d501019 100755 --- a/etc/bash_completion.d/20vyatta-cfg +++ b/etc/bash_completion.d/20vyatta-cfg @@ -66,6 +66,28 @@ save () \"umask 0002 ; ${vyatta_sbindir}/vyatta-save-config.pl $@\"" } +discard () +{ + local changes + if [ -f "$VYATTA_TEMP_CONFIG_DIR/$VYATTA_MOD_NAME" ]; then + changes=1 + else + changes=0 + fi + + sudo umount ${VYATTA_TEMP_CONFIG_DIR}; + rm -fr ${VYATTA_CHANGES_ONLY_DIR}; + mkdir -p ${VYATTA_CHANGES_ONLY_DIR}; + sudo mount -t unionfs -o dirs=${VYATTA_CHANGES_ONLY_DIR}=rw:${VYATTA_ACTIVE_CONFIGURATION_DIR}=ro unionfs ${VYATTA_TEMP_CONFIG_DIR}; + + if (( changes )); then + echo "Changes have been discarded" + else + echo "No changes have been discarded" + fi + +} + reboot () { echo "Exit from configure mode before rebooting." diff --git a/etc/shell/level/users/allowed-op b/etc/shell/level/users/allowed-op index 724c235..5b997da 100644 --- a/etc/shell/level/users/allowed-op +++ b/etc/shell/level/users/allowed-op @@ -1,3 +1,4 @@ +discard clear debug exit |