diff options
author | Christian Breunig <christian@breunig.cc> | 2023-05-21 23:13:52 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2023-05-21 23:13:52 +0200 |
commit | 9dedb8db1a7bd664dcf140aa64e3bbde4617c4bd (patch) | |
tree | 02b002520ed253fae560981984e571b4f2d9e742 | |
parent | 634913a9c365e73aa67e1478bc01d85fc52d54d6 (diff) | |
download | vyatta-op-9dedb8db1a7bd664dcf140aa64e3bbde4617c4bd.tar.gz vyatta-op-9dedb8db1a7bd664dcf140aa64e3bbde4617c4bd.zip |
T5234: add bash prompt identifier for given VRF instance
-rw-r--r-- | etc/default/vyatta.in | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/etc/default/vyatta.in b/etc/default/vyatta.in index 9841dc5..a214ccb 100644 --- a/etc/default/vyatta.in +++ b/etc/default/vyatta.in @@ -1,4 +1,3 @@ - # declare configured Vyatta shell environment variables # first set vars per args of the "source /etc/default/vyatta VAR=FOO" @@ -18,7 +17,7 @@ unset _vyatta_extglob for var in prefix exec_prefix datarootdir ; do eval test -n \"\$$var\" \&\& _vyatta_save_$var=\$$var done - + prefix=@prefix@ exec_prefix=@exec_prefix@ datarootdir=@datarootdir@ @@ -177,6 +176,11 @@ unset _vyatta_extglob declare -x -r vyos_validators_dir=$vyos_libexec_dir/validators fi + if test -z "$VRF" ; then + VRF=$(ip vrf identify) + [ -n "$VRF" ] && declare -x -r VRF="${VRF}" + fi + } 2>/dev/null || : [ -r /etc/default/vyatta-cfg ] && source /etc/default/vyatta-cfg |