diff --git a/rootfs/standard/usr/bin/mynode-install-extra b/rootfs/standard/usr/bin/mynode-install-extra index 543c0148..6c796937 100755 --- a/rootfs/standard/usr/bin/mynode-install-extra +++ b/rootfs/standard/usr/bin/mynode-install-extra @@ -7,7 +7,7 @@ source /usr/share/mynode/mynode_config.sh source /usr/share/mynode/mynode_app_versions.sh # Make sure we have an app argument -if [ "$#" -ne 1 ]; then +if [ "$#" -lt 1 ]; then echo "Usage: mynode-install-extra " exit 1 fi @@ -22,6 +22,24 @@ APP="$1" if [ "$APP" = "rust" ] || [ "$APP" = "cargo" ]; then wget https://sh.rustup.rs -O /tmp/setup_rust.sh /bin/bash /tmp/setup_rust.sh -y +elif [ "$APP" = "electrs" ]; then + mkdir -p /home/admin/download + cd /home/admin/download + rm -rf electrs-*.tar.gz + rm -rf electrs + + URL="https://github.com/romanz/electrs/archive/refs/tags/v0.9.2.tar.gz" + if [ "$#" -eq 2 ]; then + URL="$2" + fi + wget $URL -O electrs.tar.gz + tar -xvf electrs.tar.gz + mv electrs-* electrs + + cd electrs + cargo build --release + sudo install -g root -o root target/release/electrs /usr/bin/electrs + cd ~ else echo "Dont know what to do for app: $APP" exit diff --git a/rootfs/standard/usr/bin/mynode_post_upgrade.sh b/rootfs/standard/usr/bin/mynode_post_upgrade.sh index 9cd8ec5f..90a18813 100755 --- a/rootfs/standard/usr/bin/mynode_post_upgrade.sh +++ b/rootfs/standard/usr/bin/mynode_post_upgrade.sh @@ -507,28 +507,7 @@ fi cd ~ -# Upgrade electrs -# ELECTRS_UPGRADE_URL=https://github.com/romanz/electrs/archive/$ELECTRS_VERSION.tar.gz -# CURRENT="" -# if [ -f $ELECTRS_VERSION_FILE ]; then -# CURRENT=$(cat $ELECTRS_VERSION_FILE) -# fi -# if [ "$CURRENT" != "$ELECTRS_VERSION" ]; then -# cd /opt/mynode -# rm -rf electrs - -# rm -f electrs.tar.gz -# wget $ELECTRS_UPGRADE_URL -O electrs.tar.gz -# tar -xzf electrs.tar.gz -# rm -f electrs.tar.gz -# mv electrs-* electrs - -# cd electrs -# cargo build --release -# install -g root -o root target/release/electrs /usr/bin/electrs -# echo $ELECTRS_VERSION > $ELECTRS_VERSION_FILE -# fi -# cd ~ +# Upgrade electrs (just mark version, included in overlay) echo $ELECTRS_VERSION > $ELECTRS_VERSION_FILE diff --git a/setup/setup_device.sh b/setup/setup_device.sh index b951a8c6..8f355e6f 100755 --- a/setup/setup_device.sh +++ b/setup/setup_device.sh @@ -549,28 +549,7 @@ fi cd ~ -# Install Electrs (only build to save new version, now included in overlay) -# ELECTRS_UPGRADE_URL=https://github.com/romanz/electrs/archive/$ELECTRS_VERSION.tar.gz -# CURRENT="" -# if [ -f $ELECTRS_VERSION_FILE ]; then -# CURRENT=$(cat $ELECTRS_VERSION_FILE) -# fi -# if [ "$CURRENT" != "$ELECTRS_VERSION" ]; then -# cd /opt/mynode -# rm -rf electrs - -# rm -f electrs.tar.gz -# wget $ELECTRS_UPGRADE_URL -O electrs.tar.gz -# tar -xzf electrs.tar.gz -# rm -f electrs.tar.gz -# mv electrs-* electrs - -# cd electrs -# cargo build --release -# install -g root -o root target/release/electrs /usr/bin/electrs -# echo $ELECTRS_VERSION > $ELECTRS_VERSION_FILE -# fi -# cd ~ +# Install Electrs (just mark version, now included in overlay) echo $ELECTRS_VERSION > $ELECTRS_VERSION_FILE