DevOPS scripts
Advanced template for questions in bash scripts.
Mounting Hetzner Storage box via SSHFS. Change uXXXXX to your Hetzner Box username. Other options is up to you.
The script is used for fast temporary and safe mounting/unmounting of the Hetzner box. For permanent mounts, use fstab and other faster protocols (SMB/WebDAV). The script checks for the presence of a directory to mount, the necessary packages and keys. It can also generate ssh keys and copy them to storage. Root access is not needed. For convenience, the directory is mounted with the permissions of the current user.
Delete files older than $days_old from a specified directory and notify about the deleted files via Telegram
This script monitors domain expiration dates from a specified file, sending Telegram notifications when any domain is within 30 days of expiry.
Add all files, ask for message, commit it and push to github.
Create ssh-keys, copy it to new server and create alias for ssh. It will generate new ssh key pair for every host.
apt update, upgrade and install some packages on new debian-based server.
SSH to remote server, do apt update and full-upgrade, modify the Hostname directive in /etc/zabbix/zabbix_agentd.conf and restart zabbix-agent service.
Simple script to send telegram message and logging. Don't forget to change YOUR_BOT_TOKEN, YOUR_CHAT_ID and /PATH/TO/FILE.LOG. Also change the YOUR_TEXT or simply delete YOUR_TEXT from the script and use it like
./telegram_send.sh "Hello world!"
(Made with ChatGPT 3.5 help)