asmmenu.sh aktualisiert
xmrig cpu kerne einstellung hinzugefügt
This commit is contained in:
32
asmmenu.sh
32
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"
|
VERSION_URL="https://gitea.ris-universe.eu/w12/w12-asm-os/raw/branch/main/version.txt"
|
||||||
LOCAL_VERSION="1.0.3"
|
LOCAL_VERSION="1.0.3"
|
||||||
|
|
||||||
|
# Nach Reboot Marker entfernen
|
||||||
UPTIME=$(cut -d. -f1 /proc/uptime)
|
UPTIME=$(cut -d. -f1 /proc/uptime)
|
||||||
if [ "$UPTIME" -lt 120 ]; then
|
if [ "$UPTIME" -lt 120 ]; then
|
||||||
rm -f /tmp/asm_quit
|
rm -f /tmp/asm_quit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Wenn Marker existiert → nicht nochmal starten
|
# Falls bereits beendet → nicht erneut starten
|
||||||
if [ -f /tmp/asm_quit ]; then
|
if [ -f /tmp/asm_quit ]; then
|
||||||
echo "[i] Menü wurde zuvor beendet – starte nicht erneut."
|
echo "[i] Menü wurde zuvor beendet – starte nicht erneut."
|
||||||
exit 0
|
exit 0
|
||||||
@@ -109,10 +110,31 @@ function install_xmrig() {
|
|||||||
*) POOL_PORT="10128" ;;
|
*) POOL_PORT="10128" ;;
|
||||||
esac
|
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
|
cat > "$XMRIG_DIR/config.json" <<EOF
|
||||||
{
|
{
|
||||||
"autosave": true,
|
"autosave": true,
|
||||||
"cpu": true,
|
"cpu": {
|
||||||
|
"enabled": true,
|
||||||
|
"huge-pages": true,
|
||||||
|
"hw-aes": null,
|
||||||
|
"priority": null,
|
||||||
|
"asm": true,
|
||||||
|
"threads": $CPU_THREADS
|
||||||
|
},
|
||||||
"pools": [
|
"pools": [
|
||||||
{
|
{
|
||||||
"url": "$POOL:$POOL_PORT",
|
"url": "$POOL:$POOL_PORT",
|
||||||
@@ -124,7 +146,7 @@ function install_xmrig() {
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo "[✓] XMRig wurde installiert mit Port $POOL_PORT."
|
echo "[✓] XMRig wurde installiert mit Port $POOL_PORT und $USED_CORES Kern(en)."
|
||||||
sleep 2
|
sleep 2
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,7 +244,7 @@ while true; do
|
|||||||
8) update_script ;;
|
8) update_script ;;
|
||||||
9) configure_wifi_nmtui ;;
|
9) configure_wifi_nmtui ;;
|
||||||
10) shutdown_system ;;
|
10) shutdown_system ;;
|
||||||
11) break ;;
|
11) touch /tmp/asm_quit ; break ;;
|
||||||
*) echo "Ungültige Auswahl";;
|
*) echo "Ungültige Auswahl";;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user