Created
November 28, 2020 13:49
-
-
Save sebastiandeutsch/16e4a463bcfafe1595da60aa056ad683 to your computer and use it in GitHub Desktop.
ETH2 Telegram Stuff
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
[Unit] | |
Description=Ethereum go client | |
After=network.target | |
Wants=network.target | |
[email protected] | |
StartLimitBurst=5 | |
StartLimitIntervalSec=33 | |
[Service] | |
User=goeth | |
Group=goeth | |
Type=simple | |
Restart=always | |
RestartSec=5 | |
ExecStart=geth --http --cache 4096 --datadir /var/lib/goethereum | |
[Install] | |
WantedBy=default.target |
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
export TELEGRAM_KEY="..." | |
export CHAT_ID=12345 |
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
[Unit] | |
Description=Lighthouse Beacon Node | |
Wants=network-online.target | |
After=network-online.target | |
[email protected] | |
StartLimitBurst=5 | |
StartLimitIntervalSec=33 | |
[Service] | |
Type=simple | |
User=lighthousebeacon | |
Group=lighthousebeacon | |
Restart=always | |
RestartSec=5 | |
ExecStart=/usr/local/bin/lighthouse bn --network mainnet --staking --metrics --datadir /var/lib/lighthouse --eth1-endpoint http://127.0.0.1:8545 | |
[Install] | |
WantedBy=multi-user.target |
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
[Unit] | |
Description=Lighthouse Validator | |
Wants=network-online.target | |
After=network-online.target | |
[email protected] | |
StartLimitBurst=5 | |
StartLimitIntervalSec=33 | |
[Service] | |
Type=simple | |
User=lighthousevalidator | |
Group=lighthousevalidator | |
Restart=always | |
RestartSec=5 | |
ExecStart=/usr/local/bin/lighthouse vc --network mainnet --datadir /var/lib/lighthouse --graffiti "https://eth2.9elements.com" | |
[Install] | |
WantedBy=multi-user.target |
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 | |
source /etc/telegram/key | |
URL="https://api.telegram.org/bot$TELEGRAM_KEY/sendMessage" | |
curl -s -d "chat_id=$CHAT_ID&disable_web_page_preview=1&text=$1" $URL > /dev/null |
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 | |
UNIT=$1 | |
UNITSTATUS=$(systemctl status $UNIT) | |
ALERT=$(echo -e "\u26A0") | |
telegram "$ALERT Unit failed $UNIT $ALERT | |
Status: | |
$UNITSTATUS" |
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
[Unit] | |
Description=Unit Status Telegram Service | |
After=network.target | |
[Service] | |
Type=simple | |
ExecStart=/usr/local/bin/unit-status-telegram %i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment