Skip to content
Snippets Groups Projects
Commit 9c2fc823 authored by ale's avatar ale
Browse files

Call update-ipset from update-firewall

Make it so a single call is enough to update the full firewall
configuration.

Fixes issue #2.
parent f766e7cd
Branches
No related tags found
1 merge request!5Call update-ipset from update-firewall
Pipeline #57584 passed
firewall (0.3) unstable; urgency=medium
* Unify update-firewall and update-ipset
-- Autistici/Inventati <debian@autistici.org> Sat, 26 Aug 2023 08:14:40 +0100
firewall (0.2) unstable; urgency=medium firewall (0.2) unstable; urgency=medium
* New package. * New package.
......
...@@ -4,7 +4,6 @@ Description=Set up firewall ...@@ -4,7 +4,6 @@ Description=Set up firewall
[Service] [Service]
Type=oneshot Type=oneshot
EnvironmentFile=-/etc/default/firewall EnvironmentFile=-/etc/default/firewall
ExecStart=/usr/sbin/update-ipset
ExecStart=/usr/sbin/update-firewall ExecStart=/usr/sbin/update-firewall
[Install] [Install]
......
...@@ -18,7 +18,7 @@ resolve_addr() { ...@@ -18,7 +18,7 @@ resolve_addr() {
ipv4) af=AF_INET ;; ipv4) af=AF_INET ;;
ipv6) af=AF_INET6 ;; ipv6) af=AF_INET6 ;;
esac esac
python -c "import socket ; print '\n'.join(x[4][0] for x in socket.getaddrinfo('${addr}', 0, socket.${af}, socket.SOCK_STREAM))" 2>/dev/null || true python3 -c "import socket ; print '\n'.join(x[4][0] for x in socket.getaddrinfo('${addr}', 0, socket.${af}, socket.SOCK_STREAM))" 2>/dev/null || true
} }
resolve_addr4() { resolve_addr4() {
...@@ -226,7 +226,7 @@ while [ $# -gt 0 ]; do ...@@ -226,7 +226,7 @@ while [ $# -gt 0 ]; do
exit 0 exit 0
;; ;;
--version) --version)
echo "firewall v0.2" echo "firewall v0.3"
exit 0 exit 0
;; ;;
*) *)
...@@ -240,4 +240,5 @@ done ...@@ -240,4 +240,5 @@ done
load_firewall load_firewall
exit 0 # Execute update-ipset next.
exec /usr/sbin/update-ipset
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment