This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A simple bash script to check the current status of my Docker service | |
# If the 'rc.docker status' command returns anything other than "running" a message is sent to my Telegram bot | |
# The script will attempt to restart Docker and send the result to Telegram | |
TOKEN="" | |
CHAT_ID="" | |
URL="https://api.telegram.org/bot$TOKEN/sendMessage" | |
DOCKER_STATUS_FULL="$(/etc/rc.d/rc.docker status)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A simple shell script to check if all my downloaded items have a hardlink associated with them | |
# The result will be all *.mkv items that do not have more than 1 file linked to this inode | |
# This is primarily used in Conjunction with Sonarr and Radarr for downloaded item handling | |
UNLINKED_DOWNLOADS=`find /mnt/user/Media/downloads/ -type f -links 1 -iname *.mkv` | |
[ -z "$UNLINKED_DOWNLOADS" ] && echo "All good" || echo "$UNLINKED_DOWNLOADS | |
To delete all files: | |
find /mnt/user/Media/downloads/ -type f -links 1 -iname *.mkv -exec rm -i {} \;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TOKEN=XXX | |
CHAT_ID=XXX | |
URL="https://api.telegram.org/bot$TOKEN/sendMessage" | |
LIMIT=95 | |
CACHE_LIMIT=60 | |
#Checks how much space% is consumed on the array | |
ARRAY_USED_PERCENT=`df -h /mnt/user | awk '{print $5}' | sed -ne 2p | cut -d'%' -f1` | |
#Checks how much available space there is in GB |