Answer the question
In order to leave comments, you need to log in
How to add .sh script to Ubuntu 20.04 startup?
There is a script to upgrade from Ubuntu 18.04 to Ubuntu 20.04. After sudo apt-get dist-upgrade you need to reboot. My script creates another upd2.sh which will do-release-upgrade and so on. You need to make sure that upd2.sh starts immediately after the reboot and finishes updating the system. In 20.04 there is no /etc/rc.local, Tell me what to do, much on the Internet simply does not help.
Answer the question
In order to leave comments, you need to log in
@reboot /home/user/upd2.sh in cron
Or in systemd
/etc/systemd/system/startscript.service
[Unit]
Description=My script service
After=network.target
[Service]
ExecStart=/usr/local/bin/ upd2.sh
[Install]
WantedBy=default.target
and then chmod +x /usr/local/bin/upd2.sh
systemctl daemon-reload
systemctl enable startscript.service.service
systemctl start startscript.service.service
You can make a oneshot service
https://gist.github.com/drmalex07/d006f12914b21198ee43
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question