[start]
command:
    /usr/local/sbin/pluginctl -c webproxy start;
    /usr/local/etc/rc.d/squid start 2>&1 && echo "__ok__"; exit 0
parameters:
type:script_output
message:starting proxy

[stop]
command:
    /usr/local/etc/rc.d/squid stop;
    /usr/bin/killall squid;
    /usr/local/sbin/pluginctl -c webproxy stop;
    exit 0
parameters:
type:script
message:stopping proxy

[restart]
command:
    /usr/local/sbin/pluginctl -c webproxy restart;
    /usr/local/etc/rc.d/squid restart 2>&1 && echo "__ok__"; exit 0
parameters:
type:script_output
message:restarting proxy
description:Restart Web Proxy service

[reset]
command:
    /usr/bin/killall -9 squid;
    rm /var/run/squid/squid.pid;
    rm -rf /var/squid/*;
    /usr/local/sbin/pluginctl -c webproxy start;
    /usr/local/etc/rc.d/squid start
parameters:
type:script
message:reset and restart proxy

[reload]
command:
    /usr/local/sbin/pluginctl -c webproxy reload;
    /usr/local/opnsense/scripts/proxy/deploy_error_pages.py;
    /usr/local/etc/rc.d/squid reload
parameters:
type:script
message:reload proxy

[status]
command:/usr/local/etc/rc.d/squid status;exit 0
parameters:
type:script_output
message:request proxy status

[fetchacls]
command:
    /usr/local/bin/flock -n -E 0 -o /tmp/fetchACLs.lock /usr/local/opnsense/scripts/proxy/fetchACLs.py && (
        /usr/local/sbin/pluginctl -c webproxy reload;
        /usr/local/etc/rc.d/squid reload
    )
parameters:
type:script
message:download and reload proxy ACLs from remote locations
description:Download and reload external proxy ACLs

[downloadacls]
command:/usr/local/bin/flock -n -E 0 -o /tmp/fetchACLs.lock /usr/local/opnsense/scripts/proxy/fetchACLs.py
parameters:
type:script
message:download proxy ACLs from remote locations
description:Download external proxy ACLs

[deploy_error_pages]
command:/usr/local/opnsense/scripts/proxy/deploy_error_pages.py
parameters:
type:script_output
message:deploy error pages

[download_error_pages]
command:/usr/local/opnsense/scripts/proxy/download_error_pages.py
parameters:
type:script_output
message:download error pages
