Running a few commands after host startup

mikeyo

New Member
Oct 24, 2022
21
8
3
Hi

Please can someone explain step by step the process of running the script below after the proxmox host is started?
I assume crontab is the best way, but not sure what I need to do. Thanks.

#!/bin/bash
sudo modprobe i2c-dev
sudo modprobe i2c-i801
./openrgb --server
 
Hello,

Proxmox VE is like other Linux distro, which means you can run a script on start up by adding your script into /etc/init.d/ path.

Assume the script name is (openrgb)
# vi or nano it's up to you..
- vi /etc/init.d/openrgb

Add your bash script:
#!/bin/bash
sudo modprobe i2c-dev
sudo modprobe i2c-i801
./openrgb --server

- Give it a right permission using (chmod) e.g., `chmod +x /etc/init.d/openrgb`
- Update the system startup configuration `update-rc.d openrgb defaults`
- Finally, start the service openrgb

Bash:
systemctl start openrgb
systemctl status openrgb