Autostart Script

542542345

New Member
Apr 5, 2020
1
0
1
23
Hello there,

I have recently installed Proxmox on my homeserver and on it I installed nextcloud in a lxc. Due to electricity cost
I want to shut my server down when the server is idling and when I want to start it I usually connect to a website hosted
on my rpi zero where I click a button, which will execute a wol bash script.

Now I would like to have an autostart script running on my proxmox server which checks if my cloud is running,
something like
Bash:
#!/bin/bash
running=$(grep running pct list)
if $running = "running"
then
    #execute post script
which then sends a post script to my pi.
If this post request is received by my pi it redirects me to my cloud.

So my question now is, how can I autostart a script which sends get/post requests to my pi?
 
That's a bit of an unusual setup, so I can't give you an exact solution, but I suppose you could cobble something together with hookscripts (e.g. send your POST when the container has started, and then just busy-wait on the raspberry until the cloud is reachable?).

See here for an example on hookscripts. (doesn't have to a perl script BTW, anything executable that can deal with cmdline parameters is fine)