SystemD is a system and service manager for Linux. In order to run a command or program when the Pi boots, it can be added as a service. Once this is done, the command can start/stop enable/disable from the Linux prompt.
Show system status:
Activates the service "example1" immediately:
systemctl start example1
Deactivates the service "example1" immediately:
# systemctl stop example1
Restarts the service "example1" immediately:
systemctl restart example1
Shows status of the service "example1":
systemctl status example1
Enables "example1" to be started on bootup:
systemctl enable example1
Disables "example1" to not start during bootup:
systemctl disable example1
The following code will create ssid_update.service file.
sudo nano /etc/systemd/system/ssid_update.service
ssid_update.service will execute acc_point_update.sh file
Description=Update SSID and PWD
To start and enable the service the following code is used.
sudo systemctl start ssid_update.service
sudo systemctl enable ssid_update.service
By executing the start command the following code will run: