Files
ProxmoxHelper/Playground/testDetermineType.sh
2022-04-15 22:42:28 +02:00

10 lines
233 B
Bash

#!/bin/bash
ID=100
#ID=$1
VMS=$(qm list | tail -n+2 | awk '{print $1}')
CTS=$(pct list | tail -n+2 | awk '{print $1}')
#Determine id type
if [[ $VMS =~ $ID ]]; then TYPE=VM; fi
if [[ $CTS =~ $ID ]]; then TYPE=CT; fi
echo ID is $TYPE