refresh-couriers.sh raw
1 #!/bin/sh
2 # cron: 0 3 * * 0 /opt/zlattea/scripts/refresh-couriers.sh
3 # syncs econt + speedy office lists into the db
4 set -e
5 cd /opt/zlattea
6 bun -e '
7 const { refreshAllOffices } = require("./src/lib/couriers");
8 refreshAllOffices().then(n => { console.log(`courier sync: econt=${n.econt} speedy=${n.speedy}`); process.exit(0); }).catch(e => { console.error("courier sync failed:", e.message); process.exit(1); });
9 '
10