metrics lxc
This commit is contained in:
parent
0559c57556
commit
02596b8624
7 changed files with 222 additions and 20 deletions
10
Taskfile
10
Taskfile
|
|
@ -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}"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue