This file contains hidden or 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
[Unit] | |
Description=C-Lightning daemon | |
Requires=bitcoind.service | |
Requires=getpubip.service | |
After=bitcoind.service | |
[Service] | |
# get var PUBIP from file | |
EnvironmentFile=/etc/pubip/pubip |
This file contains hidden or 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
[Unit] | |
Description=getpubip.sh: get public ip address from ipinfo.io | |
After=network.target | |
[Service] | |
Type=oneshot | |
ExecStart=/opt/pubip/getpubip.sh | |
[Install] | |
WantedBy=multi-user.target |
This file contains hidden or 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 | |
# getpubip.sh, use with systemd service and hourly timer | |
PUBIPADDR=$(curl v4.ifconfig.co) | |
echo "PUBIP_V4=$PUBIPADDR" > /etc/pubip/pubip | |
PUBIPADDR6=$(curl v6.ifconfig.co) | |
echo "PUBIP_V6=$PUBIPADDR6" | tee -a /etc/pubip/pubip |
This file contains hidden or 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 | |
# The script could use more testing, but it works well for my needs | |
extract_rar() { | |
isRar=$(ls ./*.rar) | |
if [ -n "$isRar" ]; then | |
# Handle an edge case with some distributors | |
isPart01="$(ls ./*rar | grep -E part0*1.rar)" | |
if [ -n "$isPart01" ]; then | |
isRar=$isPart01 |
This file contains hidden or 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 | |
####################################################################### | |
# This is a helper script that keeps snapraid parity info in sync with | |
# your data and optionally verifies the parity info. Here's how it works: | |
# 1) It first calls diff to figure out if the parity info is out of sync. | |
# 2) If parity info is out of sync, AND the number of deleted files exceed | |
# X (configurable), it triggers an alert email and stops. (In case of | |
# accidental deletions, you have the opportunity to recover them from | |
# the existing parity info) | |
# 3) If partiy info is out of sync, AND the number of deleted files exceed X |