[Unit] description=Saves geolocation to a file Wants=network-online.target After=network-online.target [Service] Type=oneshot # Using $XDG_STATE_HOME would be preferable, but systemd/sh doesn't play nice with environment variables ExecStart=/bin/sh -c 'curl "https://ipapi.co/json/" -o "/home/mbradley/.cache/ip.json"' [Install] WantedBy=default.target