Create a systemd service unit file.
Create a file named /etc/systemd/system/sharewiz-firewall.service:
[Unit] Description=Runs the firewall. [Service] [Unit] Description=Runs the firewall. [Service] ExecStart=/sharewiz/firewall/firewall.sh ExecStop=/sharewiz/firewall/firewall-reset.sh Type=oneshot RemainAfterExit=yes [Install] #WantedBy=multi-user.target WantedBy=default.target
NOTE: Ensure that the script that is going to be run is executable.
sudo chmod 644 /etc/systemd/system/sharewiz-firewall.service sudo systemctl daemon-reload sudo systemctl enable sharewiz-firewall.service
NOTE: The systemctl daemon-reload command reloads all unit files, including the new unit file created for the firewall.