-
Notifications
You must be signed in to change notification settings - Fork 0
Create a boot script
Matteo Fumagalli edited this page Feb 17, 2018
·
2 revisions
Create a file named mystartup.service at
vi /etc/systemd/system/mystartup.service
[Unit]
Description=myaustart
After=network.target
[Service]
ExecStart=/root/init.sh
Type=oneshot
[Install]
WantedBy=multi-user.target
Now let's create the init.sh script that will be called after boot:
vi ~/init.sh
#!/bin/sh
touch /root/test.txt #create a file test after boot
chmod +x ~/init.sh
systemctl enable mystartup.service