summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/vyatta-show-log-file7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/vyatta-show-log-file b/scripts/vyatta-show-log-file
index 1f8a0ef..caf8ac9 100755
--- a/scripts/vyatta-show-log-file
+++ b/scripts/vyatta-show-log-file
@@ -1,6 +1,11 @@
#!/bin/bash
-if [ -f /var/log/user/$1 ]; then
+if [[ "$1" == */* ]]; then
+ echo "Invalid log file name"
+ exit 1
+fi
+
+if [ -f "/var/log/user/$1" ]; then
cat /var/log/user/$1
else
echo "No such log file"