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.