diff --git a/asmmenu.sh b/asmmenu.sh index f2eef03..8da2f09 100644 --- a/asmmenu.sh +++ b/asmmenu.sh @@ -8,12 +8,13 @@ UPDATE_URL="https://gitea.ris-universe.eu/w12/w12-asm-os/raw/branch/main/asmmenu VERSION_URL="https://gitea.ris-universe.eu/w12/w12-asm-os/raw/branch/main/version.txt" LOCAL_VERSION="1.0.3" +# Nach Reboot Marker entfernen UPTIME=$(cut -d. -f1 /proc/uptime) if [ "$UPTIME" -lt 120 ]; then rm -f /tmp/asm_quit fi -# Wenn Marker existiert → nicht nochmal starten +# Falls bereits beendet → nicht erneut starten if [ -f /tmp/asm_quit ]; then echo "[i] Menü wurde zuvor beendet – starte nicht erneut." exit 0 @@ -109,10 +110,31 @@ function install_xmrig() { *) POOL_PORT="10128" ;; esac + TOTAL_CORES=$(nproc) + USED_CORES=$(whiptail --inputbox "Wie viele CPU-Kerne von $TOTAL_CORES sollen verwendet werden?" 8 60 "$TOTAL_CORES" 3>&1 1>&2 2>&3) + + if ! [[ "$USED_CORES" =~ ^[0-9]+$ ]] || [ "$USED_CORES" -lt 1 ] || [ "$USED_CORES" -gt "$TOTAL_CORES" ]; then + echo "[!] Ungültige Eingabe – verwende alle $TOTAL_CORES Kerne." + USED_CORES=$TOTAL_CORES + fi + + CPU_THREADS="" + for ((i=0; i "$XMRIG_DIR/config.json" <