#!/bin/sh
# Fleet v2 rule 2.4: a computer asks its fleet for news when it joins a network or brings up a VPN. NetworkManager
# runs this as root with $1 = interface, $2 = action. The poke returns at once and does nothing without a fleet.
case "$2" in
    up|vpn-up|connectivity-change) ;;
    *) exit 0 ;;
esac
[ -S /run/starchaser/fleet/root.sock ] || exit 0
timeout 15 /usr/local/lib/starchaser/starchaser-fleet-root poke >/dev/null 2>&1 &
exit 0
