Update README.md

This commit is contained in:
Frank Bernhardt 2024-05-23 07:54:29 +02:00 committed by GitHub
parent bc9395e0e2
commit f3c242d960
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -846,4 +846,33 @@ DELAY 500
STRING :q!
DELAY 500
ENTER
```
```
## The DevOps way
Credit: @frank-bee
```
provider "local" {
version = "~> 2.0"
}
resource "local_file" "exit_vim_script" {
content = <<-EOF
#!/bin/bash
ps axuw | grep vim | grep -v grep | awk '{print $2}' | xargs kill -9
EOF
filename = "${path.module}/exit_vim.sh"
file_permission = "0755"
}
resource "null_resource" "run_exit_vim_script" {
provisioner "local-exec" {
command = "${path.module}/exit_vim.sh"
}
triggers = {
always_run = "${timestamp()}"
}
}
```