Problem with the job-end on my hook script

cazz

Member
Jul 18, 2021
65
2
13
46
Sweden
Hi
I run this script to control my PBS server

Bash:
!/bin/bash

if [ "$1" == "job-init" ]; then
pvesm set PBS --disable 0
wakeonlan 40:B0:34:3D:26:EC   #(mac Address of PBS Server)
ping 192.168.1.3 -c 60
fi

if [ "$1" == "job-end" ]; then
pvesm set PBS --disable 1
ssh root@192.168.1.3 "poweroff < /dev/null &"
fi

exit 0

I have no problem to run "job-init" but "job-end" does not work.
When I run they two command manual I have no error so it is something about the if

My Promox server is running with version 7.2.-7
 
I'd try adding an echo statement like in the example script to check when the hook script is called and with what parameters.. for example, job-end might get skipped and job-abort called instead.
 

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!