two_with_bash/agent.sh
2025-05-16 14:02:04 +02:00

47 lines
No EOL
784 B
Bash

#!/bin/bash
# red delete
# orange check-no-delete
# orange check-no-create
# green create
. ./lib/prime/volumes.sh
. ./lib/prime/init.sh
. ./lib/prime/vm.sh
DRY_RUN="1"
SIMULATION="1"
function main {
fonction="${1}"
shift 1
case "${fonction}" in
"StartVm")
start_vm "$@"
;;
"StopVm")
stop_vm "$@"
;;
"CreateVolume")
create_volume "$@"
;;
"DeleteVolume")
delete_volume "$@"
;;
"Config")
config_kvm
;;
*)
echo "action : ${fonction} not known !"
echo "avalable action :"
echo " -> StartVm"
echo " -> StopVm"
echo " -> CreateVolume"
echo " -> DeleteVolume"
echo " -> Config"
;;
esac
}
main "$@"