From 29662246b32dd27b2540ae766684f2c634e8d044 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 24 Aug 2009 12:15:06 -0700 Subject: Add a small script to test for node existance This does the same thing as vyatta-quagga-utils.pl --exists, but it is generally useful (outside quagga) and has less overhead than a perl compile. --- scripts/vyatta-exists | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 scripts/vyatta-exists (limited to 'scripts') diff --git a/scripts/vyatta-exists b/scripts/vyatta-exists new file mode 100755 index 0000000..ef2dea3 --- /dev/null +++ b/scripts/vyatta-exists @@ -0,0 +1,14 @@ +#! /bin/bash + +# Test if given node exists in Vyatta config hierarchy +# +# if vyatta-exists interfaces wireless + +if [ -z "$VYATTA_TEMP_CONFIG_DIR" ]; then + echo "$0: not in configuration mode" 1>&2; + exit 1; +fi +IFS=/ +node=$* +IFS= +exec test -d $VYATTA_TEMP_CONFIG_DIR/$node -- cgit v1.2.3