From 1efd20ab21e75e421487d563fc794a7f97361a3e Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 26 Dec 2020 17:12:29 +0100 Subject: webproxy: T563: op-mode: initial command support --- op-mode-definitions/webproxy.xml | 121 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 op-mode-definitions/webproxy.xml (limited to 'op-mode-definitions') diff --git a/op-mode-definitions/webproxy.xml b/op-mode-definitions/webproxy.xml new file mode 100644 index 000000000..09cefb929 --- /dev/null +++ b/op-mode-definitions/webproxy.xml @@ -0,0 +1,121 @@ + + + + + + + Monitor WebProxy service + + ${vyatta_bindir}/vyatta-monitor Webproxy squid + + + + Monitor the last lines of the squid access log + + if [ -f /var/log/squid3/access.log ]; then sudo tail --follow=name /var/log/squid3/access.log; else echo "WebProxy cache-log does not exist"; fi + + + + Monitor Webproxy in the background + + + + + Start background monitoring of Webproxy + + ${vyatta_bindir}/vyatta-monitor-background Webproxy squid + + + + Stop background monitoring of Webproxy + + ${vyatta_bindir}/vyatta-monitor-background-stop Webproxy + + + + + + Monitor the last lines of the squid cache log + + if [ -f /var/log/squid3/cache.log ]; then sudo tail --follow=name /var/log/squid3/cache.log; else echo "WebProxy cache-log does not exist"; fi + + + + + + + + + + Restart WebProxy service + + if cli-shell-api existsActive service webproxy; then sudo systemctl restart squid.service; else echo "Service WebProxy not configured"; fi + + + + + + + + Show WebProxy information + + + + + + Show webproxy blacklist information + + + + + Show webproxy blacklist categories + + ${vyos_completion_dir}/list_webproxy_category.sh + + + + + + Show contents of WebProxy access log + + if [ -e /var/log/squid/access.log ]; then sudo less $_vyatta_less_options --prompt="file %i of %m, page %dt of %D" -- `printf "%s\n" /var/log/squid/access.log* | sort -nr`; else echo "No WebProxy log"; fi + + + + Show update log for url-filter database + + if [ -e /config/url-filtering/squidguard/updatestatus ]; then cat /config/url-filtering/squidguard/updatestatus; else echo "Update log not found"; fi + + + + + + + + + + Update WebProxy + + + + + Update the webproxy blacklist database + + + + + Update a category of the webproxy blacklist database + + + + + sudo /usr/libexec/vyos/legacy/vyatta-sg-blacklist.pl --update-blacklist-category="$5" + + + sudo /usr/libexec/vyos/legacy/vyatta-sg-blacklist.pl --update-blacklist + + + + + + -- cgit v1.2.3