Use Proxmox shell API to get container ID
This commit is contained in:
parent
02895331e3
commit
bd6cd3c932
12
install.sh
12
install.sh
@ -44,17 +44,7 @@ STORAGE_TYPE=`pvesm status -storage $STORAGE | awk 'NR>1 {print $2}'`
|
|||||||
info "Using '$STORAGE' for storage location."
|
info "Using '$STORAGE' for storage location."
|
||||||
|
|
||||||
# Get the next guest VM/LXC ID
|
# Get the next guest VM/LXC ID
|
||||||
VMID=$(cat<<EOF | python3
|
VMID=$(pvesh get /cluster/nextid)
|
||||||
import json
|
|
||||||
with open('/etc/pve/.vmlist') as vmlist:
|
|
||||||
vmids = json.load(vmlist)
|
|
||||||
if 'ids' not in vmids:
|
|
||||||
print(100)
|
|
||||||
else:
|
|
||||||
last_vm = sorted(vmids['ids'].keys())[-1:][0]
|
|
||||||
print(int(last_vm)+1)
|
|
||||||
EOF
|
|
||||||
)
|
|
||||||
info "Container ID is $VMID."
|
info "Container ID is $VMID."
|
||||||
|
|
||||||
# Get latest Home Assistant disk image archive URL
|
# Get latest Home Assistant disk image archive URL
|
||||||
|
Loading…
Reference in New Issue
Block a user