Proxmox function: restartvm
This commit is contained in:
parent
d1fc0d6216
commit
7d4bc72dd0
15
modules/proxmox_host/functions/restartvm.fish
Normal file
15
modules/proxmox_host/functions/restartvm.fish
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
function restartvm --description "Restart a Proxmox VM"
|
||||||
|
if test -z "$argv[1]"
|
||||||
|
echo "Usage: restartvm <vmid> [delay]"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
set -l vmid $argv[1]
|
||||||
|
set -l delay $argv[2]
|
||||||
|
|
||||||
|
test -n "$delay"; or set delay 10
|
||||||
|
|
||||||
|
qm stop "$vmid"
|
||||||
|
and sleep "$delay"
|
||||||
|
and qm start "$vmid"
|
||||||
|
end
|
||||||
Loading…
x
Reference in New Issue
Block a user