17 lines
842 B
Plaintext
17 lines
842 B
Plaintext
|
#!/bin/sh
|
||
|
# systemd user service timer setup for czds - developed by acidvegas (https://git.acid.vegas/czds)
|
||
|
# dont forget to export your CZDS_USER and CZDS_PASS before running
|
||
|
|
||
|
CZDS='/path/to/czds'
|
||
|
|
||
|
systemd_service() {
|
||
|
mkdir -p $HOME/.config/systemd/user
|
||
|
printf "[Unit]\nDescription=ICANN Centralized Zone Data Service (CZDS) Updater\n\n[Service]\nType=oneshot\nExecStart=$CZDS" > $HOME/.config/systemd/user/czds.service
|
||
|
printf "[Unit]\nDescription=Timer for ICANN Centralized Zone Data Service (CZDS) Updater\n\n[Timer]\nOnCalendar=monthly\nPersistent=true\n\n[Install]\nWantedBy=timers.target" > $HOME/.config/systemd/user/czds.timer
|
||
|
systemctl --user daemon-reload
|
||
|
systemctl --user enable czds.timer && systemctl --user start czds.timer
|
||
|
}
|
||
|
|
||
|
cronjob() {
|
||
|
(crontab -l 2>/dev/null; echo "0 3 1 * * $CZDS") | crontab -
|
||
|
}
|