metrics lxc

This commit is contained in:
Robert Perce 2025-08-23 23:14:40 -05:00
parent 0559c57556
commit 02596b8624
7 changed files with 222 additions and 20 deletions

View file

@ -12,7 +12,11 @@ build() {
dump() {
build "$@"
sudo cp -f result/vzdump* /mnt/share/proxmox/dump/
if [ -a "vm-$1.nix" ]; then
sudo cp -f result/vzdump* /mnt/share/proxmox/dump/
elif [ -a "lxc-$1.nix" ]; then
sudo cp -f result/tarball/nixos-system-x86_64-linux.tar.xz "/mnt/share/proxmox/dump/$1.tar.xz"
fi
}
get-ip() {
@ -20,8 +24,10 @@ get-ip() {
if [[ "$file" = "proxmox" ]]; then
echo 192.168.0.3
return
elif [[ "$file" != *.nix ]]; then
elif [[ "$file" != *.nix && -a "vm-$1.nix" ]]; then
file="vm-$1.nix"
elif [[ "$file" != *.nix && -a "lxc-$1.nix" ]]; then
file="lxc-$1.nix"
fi
grep ip4 "$file" | grep -Po "[0-9]+(\.[0-9]+){3}"
}