Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
#!/bin/bash # Assumption 1: you have lighthouse running on ubuntu with systemctl # Assumption 2: lighthouse binary is in /home/lighthouse/.cargo/bin/lighthouse # If otherwise, change the script accordingly latestVersion="3.3.0" ##Change this before running, see https://github.com/sigp/lighthouse/releases logFile="/home/lighthouse/lighthouseUpdate.log" filename="lighthouse-v"$latestVersion"-aarch64-unknown-linux-gnu.tar.gz" url="https://github.com/sigp/lighthouse/releases/download/v"$latestVersion"/lighthouse-v"$latestVersion"-aarch64-unknown-linux-gnu.tar.gz" #remove the old logfile rm $logFile currentVersion=$(/home/lighthouse/.cargo/bin/lighthouse --version) currentVersion=${currentVersion:0:25} echo 'lighthouse current version' $currentVersion echo 'Now updating lighthouse to v'$latestVersion', process started' cd lighthouse-bin/ echo 'Downloading v'$latestVersion' from ' $url wget $url > $logFile 2>&1 echo 'Unpacking '$filename tar -xvf $filename >> $logFile 2>&1 echo 'Stoppping validator and beacon node (can take some time)' sudo systemctl stop lighthousevalidator >> $logFile 2>&1 sudo systemctl stop lighthousebeacon >> $logFile 2>&1 echo 'Backing up the old bin to /home/lighthouse/.cargo/bin/_lighthouse' mv /home/lighthouse/.cargo/bin/lighthouse /home/lighthouse/.cargo/bin/_lighthouse echo 'Replacing the new binary' mv lighthouse /home/lighthouse/.cargo/bin/lighthouse installedVersion=$(/home/lighthouse/.cargo/bin/lighthouse --version) installedVersion=${installedVersion:0:25} echo 'Checking installed version: ' $installedVersion echo 'Starting beacon and validator node (can take some time)' sudo systemctl start lighthousebeacon >> $logFile 2>&1 sudo systemctl start lighthousevalidator >> $logFile 2>&1 echo 'Removing the tar compressed file '$filename rm $filename echo "Process completed! Check the logs in "$logFile echo 'if it failed, you could restore the old version('$currentVersion') with mv /home/lighthouse/.cargo/bin/_lighthouse /home/lighthouse/.cargo/bin/lighthouse'