#!/bin/sh # Noderr micronode for Linux and Raspberry Pi: install or update without typing commands. # It runs the same installer as the one-command install on https://micronodes.noderr.xyz/linux # curl -fsSL https://micronodes.noderr.xyz/install.sh | sh # That installer checks the release's Noderr signature and the file's SHA-256 before installing, # keeps your node wallet key in ~/.config/Noderr, and replaces an older install in place. # The sharing question opens in a window (Yes / No) when one can be shown, otherwise it is asked here. # Use: save this file, right-click it > Properties > Permissions > Execute: "Only owner" > OK, then double-click it # and pick "Execute in Terminal". (Some file managers show a tick box "Allow executing file as program" instead.) set -u ASK_TEXT="The Noderr micronode can share part of this device's internet connection. If you say yes, Noderr sends other people's web traffic through it, and sites they visit see this connection's IP address. It rewards you in testnet NODR during the testnet. If you say no, the node still runs and stays online, but carries no traffic. You can change this later by running this file again. Share this connection?" # 0 = yes, 1 = no (or the window was closed), 2 = no window could be shown. ask_window() { [ -n "${DISPLAY:-}${WAYLAND_DISPLAY:-}" ] || return 2 if command -v zenity >/dev/null 2>&1; then zenity --question --width=460 --title="Noderr micronode" --ok-label="Yes, share" --cancel-label="No" \ --text="$ASK_TEXT" 2>/dev/null && return 0 return 1 fi if command -v python3 >/dev/null 2>&1; then NODERR_ASK_TEXT="$ASK_TEXT" python3 -I - <<'PY' 2>/dev/null import os, sys try: import tkinter from tkinter import messagebox root = tkinter.Tk() except Exception: sys.exit(2) root.withdraw() yes = messagebox.askyesno("Noderr micronode", os.environ["NODERR_ASK_TEXT"]) root.destroy() sys.exit(0 if yes else 1) PY return $? fi return 2 } if [ -z "${NODERR_SHARE:-}" ]; then ask_window case $? in 0) NODERR_SHARE=1; export NODERR_SHARE ;; 1) NODERR_SHARE=0; export NODERR_SHARE ;; *) ;; # no window: install.sh asks in this terminal esac fi # Fetched to a file first, so a failed download is reported as a failure (a pipe would hide it). T=$(mktemp) || exit 1 if curl -fsSL https://micronodes.noderr.xyz/install.sh -o "$T"; then sh "$T" rc=$? else echo "Could not download the installer. Check the internet connection." rc=1 fi rm -f "$T" echo if [ "$rc" = 0 ]; then echo "Done. Your node is installed and starts by itself at boot. A new node comes online within about 5 minutes." echo "You can close this window." else echo "The install stopped (code $rc). Read the lines above, then run this file again." fi sleep 600