# Runs the WireGuard counter once (triggered by wg-count.timer). # Install: # sudo cp deploy/wg-count.service deploy/wg-count.timer /etc/systemd/system/ # (edit the path + interface below to match your server) # sudo systemctl daemon-reload # sudo systemctl enable --now wg-count.timer # systemctl list-timers wg-count.timer # confirm it's scheduled [Unit] Description=Write WireGuard peer count to the site JSON [Service] Type=oneshot # runs as root (default) so `wg` works. # args: . Output goes in the docroot's assets dir. # Adjust the SCRIPT path + interface to match your server. ExecStart=/bin/bash /var/www/html/scripts/wg_count.sh wg0 /var/www/html/public/assets/wireguard.json