asmmenu.sh aktualisiert

xmrig cpu kerne einstellung hinzugefügt
This commit is contained in:
w12
2025-05-16 20:32:08 +02:00
parent c34f9814d4
commit 2e2d087742

View File

@@ -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<USED_CORES; i++)); do
CPU_THREADS="$CPU_THREADS{\"index\":$i},"
done
CPU_THREADS="[${CPU_THREADS%,}]"
cat > "$XMRIG_DIR/config.json" <<EOF
{
"autosave": true,
"cpu": true,
"cpu": {
"enabled": true,
"huge-pages": true,
"hw-aes": null,
"priority": null,
"asm": true,
"threads": $CPU_THREADS
},
"pools": [
{
"url": "$POOL:$POOL_PORT",
@@ -124,7 +146,7 @@ function install_xmrig() {
}
EOF
echo "[✓] XMRig wurde installiert mit Port $POOL_PORT."
echo "[✓] XMRig wurde installiert mit Port $POOL_PORT und $USED_CORES Kern(en)."
sleep 2
}
@@ -222,7 +244,7 @@ while true; do
8) update_script ;;
9) configure_wifi_nmtui ;;
10) shutdown_system ;;
11) break ;;
11) touch /tmp/asm_quit ; break ;;
*) echo "Ungültige Auswahl";;
esac
done
done