Stephen Boston mentioned you could use a systemd service to automate it.
Create a service file under /etc/systemd/system and name it FILENAME.service
Paste this into your file:
[Unit]
Description=YOUR DESCRIPTION
Requires=network-online.target
After=network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/YOUR/PATH/TO/SCRIPT
[Install]
WantedBy=multi-user.target
Type=oneshot means it will only be executed once.
The line requires=network-online.target states that the service needs the service network to be online and only executes after=network-online.target

You can see the service (test.service) started after the network.service
To finish it up you need to enable the service with the command
sudo systemctl enable FILENAME.service
Check if your Service is enabled
sudo systemctl is-enabled FILENAME.service
You can ofcourse manually start or stop the service with
sudo systemctl start/stop/restart/status FILENAME.service
TIP: Pic was created with systemd-analyze plot > output.svg
auto lo iface lo inet loopback
– mek zek Oct 29 '19 at 10:25#!/bin/bash xtightvncviewer 192.168.0.10
. I dont know if this script is executing at all or not when placed into/etc/network/if-up.d
. Is there a way to check? – mek zek Oct 29 '19 at 10:31