summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2021-06-17 01:08:18 +0700
committerGitHub <noreply@github.com>2021-06-17 01:08:18 +0700
commit3d84a304ca0b92ec0f1d83f320d3ae5f6fd69647 (patch)
treefbd8b04aa5edc395d15561cdf89845d0763bb680
parent8b21c9effa500767eb3ffb007691ec85a7988573 (diff)
parentde6a2c23225fff47cf2f59c392f7b3fcf90d5ae0 (diff)
downloadvyatta-op-3d84a304ca0b92ec0f1d83f320d3ae5f6fd69647.tar.gz
vyatta-op-3d84a304ca0b92ec0f1d83f320d3ae5f6fd69647.zip
Merge pull request #46 from srividya0208/T3582
op-mode: T3582: Fix the function of "delete log file" command
-rw-r--r--scripts/vyatta-delete-log-file.sh2
-rw-r--r--templates/delete/log/file/node.tag/node.def3
2 files changed, 4 insertions, 1 deletions
diff --git a/scripts/vyatta-delete-log-file.sh b/scripts/vyatta-delete-log-file.sh
index 8562738..577106d 100644
--- a/scripts/vyatta-delete-log-file.sh
+++ b/scripts/vyatta-delete-log-file.sh
@@ -2,7 +2,7 @@
if [ -e /var/log/user/"$1" ]
then
- rm -f /var/log/user/"$1"
+ echo -n "" > /var/log/user/"$1"
else
echo "File does not exist"
fi
diff --git a/templates/delete/log/file/node.tag/node.def b/templates/delete/log/file/node.tag/node.def
index 95e46b6..ce4a4f7 100644
--- a/templates/delete/log/file/node.tag/node.def
+++ b/templates/delete/log/file/node.tag/node.def
@@ -1,2 +1,5 @@
help: Delete the specified log file
+allowed: local -a array ;
+ array=( /var/log/user/* ) ;
+ echo -n ${array[@]##*/}
run: sudo ${vyatta_bindir}/sudo-users/vyatta-delete-log-file.sh "$4"