@@ -61,6 +61,7 @@ usage:
61 $(basename "$0") activate [service]
61 $(basename "$0") activate [service]
62 $(basename "$0") deactivate [service]
62 $(basename "$0") deactivate [service]
63 $(basename "$0") inspect [service]
63 $(basename "$0") inspect [service]
64+ $(basename "$0") option [debug-on|debug-off]
64 $(basename "$0") apache [install|remove]
65 $(basename "$0") apache [install|remove]
@@ -77,6 +78,8 @@ deactivate service
77 stop and deactivate service daemon (systemd unit)
78 stop and deactivate service daemon (systemd unit)
78inspect service
79inspect service
79 show service status and log
80 show service status and log
82+ set one of the available options
81 install: apache site with a reverse proxy (ProxyPass)
84 install: apache site with a reverse proxy (ProxyPass)
82 remove: apache site ${APACHE_FILTRON_SITE}
85 remove: apache site ${APACHE_FILTRON_SITE}
@@ -155,6 +158,13 @@ main() {
155 remove) remove_apache_site ;;
158 remove) remove_apache_site ;;
156 *) usage "$_usage"; exit 42;;
159 *) usage "$_usage"; exit 42;;
164+ debug-on) echo; enable_debug ;;
165+ debug-off) echo; disable_debug ;;
166+ *) usage "$_usage"; exit 42;;
159 *) usage "ERROR: unknown or missing command $1"; exit 42;;
169 *) usage "ERROR: unknown or missing command $1"; exit 42;;
@@ -378,7 +388,12 @@ EOF
378 err_msg "Public service at ${PUBLIC_URL} is not available!"
388 err_msg "Public service at ${PUBLIC_URL} is not available!"
381− wait_key
391+ local _debug_on
392+ if ask_yn "Enable filtron debug mode?"; then
383 systemctl --no-pager -l status filtron.service
398 systemctl --no-pager -l status filtron.service
@@ -388,9 +403,66 @@ EOF
388 trap break 2
403 trap break 2
389 journalctl -f -u filtron
404 journalctl -f -u filtron
407+ if [[ $_debug_on == 1 ]]; then
415+ info_msg "try to enable debug mode ..."
420+ u'name': u'debug request'
424+ , u'actions': [{u'name': u'log'}]
427+with open('$FILTRON_RULES') as rules:
428+ j = json.load(rules)
431+for i in range(len(j)):
432+ if j[i].get('name') == 'debug request':
439+with open('$FILTRON_RULES', 'w') as rules:
440+ json.dump(j, rules, indent=2, sort_keys=True)
443+ systemctl restart "${SERVICE_NAME}.service"
447+ info_msg "try to disable debug mode ..."
450+with open('$FILTRON_RULES') as rules:
451+ j = json.load(rules)
454+for i in range(len(j)):
455+ if j[i].get('name') == 'debug request':
460+ with open('$FILTRON_RULES', 'w') as rules:
461+ json.dump(j, rules, indent=2, sort_keys=True)
463+ systemctl restart "${SERVICE_NAME}.service"
394install_apache_site() {
466install_apache_site() {
396 rst_title "Install Apache site $APACHE_FILTRON_SITE"
468 rst_title "Install Apache site $APACHE_FILTRON_SITE"