Last active
January 10, 2022 20:29
-
-
Save michaelsbradleyjr/2506aeed955ff838c0f4bca32ed68598 to your computer and use it in GitHub Desktop.
geth.service
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
#!/usr/bin/env bash | |
dig TXT +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'"' '{ print $2}' |
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=Go Ethereum | |
[Service] | |
Type=simple | |
WorkingDirectory=/home/me | |
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment GETH_EXT_IP=$$(/home/me/.local/bin/ext-ip.sh)" | |
ExecStart=/home/me/.local/bin/geth \ | |
--nat extip:${GETH_EXT_IP} \ | |
--ws | |
StandardError=append:/home/me/.ethereum/geth.log | |
PermissionsStartOnly=true | |
User=me | |
Group=me | |
Restart=always | |
RestartSec=5 | |
[Install] | |
WantedBy=default.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment