Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 1.73 KB

README.md

File metadata and controls

39 lines (28 loc) · 1.73 KB

devops

DevOPS scripts

asking template.sh

Advanced template for questions in bash scripts.

box_mount.sh

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.

cleanup.sh

Delete files older than $days_old from a specified directory and notify about the deleted files via Telegram

domain-expiration-notice.sh

This script monitors domain expiration dates from a specified file, sending Telegram notifications when any domain is within 30 days of expiry.

gitpush.sh

Add all files, ask for message, commit it and push to github.

newssh-key.sh

Create ssh-keys, copy it to new server and create alias for ssh. It will generate new ssh key pair for every host.

newssh-routine.sh

apt update, upgrade and install some packages on new debian-based server.

rename-zabbix-hosts.sh

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.

telegram_send.sh

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)