summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-exists14
1 files changed, 14 insertions, 0 deletions
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