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
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!