The trap to avoid when installing custom software is to update it. It seems obvious but it is never very easy because there is often a compilation part, interoperability management between bricks, backups and so on.
It is clearly necessary to have deployed a Vaultwarden instance on your server. I wrote an article about this topic here: https://illuad.fr/2020/06/11/install-vaultwarden.html
Since a message is sent to a Telegram bot, it is necessary to have one configured. I wrote an article about this topic here: https://illuad.fr/2020/10/27/get-a-telegram-alert-on-a-ssh-login-with-pam.html
### System
This script can run on any GNU/Linux machine.
This script uses `git`, `cargo`, `curl` and `restorecon` commands but if you have followed my article, some of them are required which means they will necessarily be installed.
## Installation
Since this script must be executed with root rights, it is a good practice to place it in `/usr/local/sbin/`.
Variables `key` and `chat_id` correspond to the API key and the chat id obtained during the bot creation process. The variable `username` must match the username with which you installed Vaultwarden.