This commit fixes #1

This commit is contained in:
whiskerz007 2019-02-19 07:32:24 +01:00
parent 62a63d3b7f
commit 12350dd855

View File

@ -4,8 +4,11 @@ VMID=$(cat<<EOF | python3
import json import json
with open('/etc/pve/.vmlist') as vmlist: with open('/etc/pve/.vmlist') as vmlist:
vmids = json.load(vmlist) vmids = json.load(vmlist)
if 'ids' not in vmids:
print(100)
else:
last_vm = sorted(vmids['ids'].keys())[-1:][0] last_vm = sorted(vmids['ids'].keys())[-1:][0]
print(int(last_vm)+1) if last_vm else print(100) print(int(last_vm)+1)
EOF EOF
) && \ ) && \
echo -e "\n\n\n" \ echo -e "\n\n\n" \