Hi!
Can someone tell me which network service I have to use in Ubuntu Mate 18.04 for a “update-script” @ Unbound?
“update-r00t-hintz.service”
Here’s the code:
[Unit]
Description=####//:"UPDATE ‘r00t-h!NtZ’:\####
[email protected] (???)
[Service]
TimeoutStartSec=0
Restart=on-failure
RestartSec=1200
ExecStartPre=/bin/sleep 120
ExecStart=/usr/bin/bash -c ‘isitalive=$(/usr/bin/systemctl is-active [email protected]); if [ “$isitalive” == “active” ]; then /usr/bin/curl -v -o /var/lib/unbound/root.hints https://www.internic.net/domain/named.cache; fi; if [ “$isitalive” == “inactive” ]; then exit 1; fi’
Terminal shows “active” when I type in “/usr/bin/systemctl is-active [email protected]”
Terminal shows “inactive” when I type in “/usr/bin/systemctl is-active [email protected]”
I don’t use dhcpcd.
What is correct to run the update-script correctly?
or?
After=syslog.target local-fs.target network.target ?
[SOLVED]
sudo su
create file in: /etc/systemd/system/root-hints-update.service
add:
[Unit]
Description=####//:UPd@Te ‘r00t’ h!ntz @ UNBOUND:\####
After=network-online.target
Part0f=root-hints-update.timer
[Service]
TimeoutStartSec=0
Restart=on-failure
RestartSec=1200
ExecStartPre=/bin/sleep 120
ExecStart=/usr/bin/curl -v -o /var/lib/unbound/root.hints https://www.internic.net/domain/named.cache
####//:“SeCUr!Ty”:\####
InaccessiblePaths=/boot
ProtectSystem=full
ProtectHome=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
PrivateTmp=yes
PrivateDevices=yes
MemoryDenyWriteExecute=yes
NoNewPrivileges=yes
RestrictRealtime=yes
RestrictAddressFamilies=AF_INET
RestrictAddressFamilies=~AF_INET6
[Install]
WantedBy=network-online.target
and:
create file in: /etc/systemd/system/root-hints-update.timer
[Unit]
Description=####//:rUN ‘r00t’ h!NtZ-UPd@Te m0NThly:\####
[Timer]
OnCalendar=--12 2:00:00
Persistent=true
[Install]
WantedBy=timers.target
then:
sudo systemctl daemon-reload
sudo systemctl enable root-hints-update.timer
sudo systemctl start root-hints-update.timer
sudo systemctl status root-hints-update.timer
sudo systemctl enable root-hints-update.service
sudo systemctl start root-hints-update.service
sudo systemctl status root-hints-update.service