mirror of
https://github.com/elseif/MikroTikPatch.git
synced 2026-08-26 10:05:50 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6cbdbffbcb | ||
|
|
6d27075389 |
53
chr.sh
53
chr.sh
@@ -3,26 +3,41 @@ set -e
|
||||
LATEST_VERSION="${1:-7.19.4}"
|
||||
echo "VERSION: $LATEST_VERSION"
|
||||
ARCH=$(uname -m)
|
||||
case $ARCH in
|
||||
x86_64|i386|i486|i586|i686)
|
||||
echo "ARCH: $ARCH"
|
||||
if [ -d /sys/firmware/efi ]; then
|
||||
echo "BOOT MODE: UEFI"
|
||||
|
||||
if [[ $LATEST_VERSION == 7.* ]]; then
|
||||
case $ARCH in
|
||||
x86_64|i386|i486|i586|i686)
|
||||
echo "ARCH: $ARCH"
|
||||
if [ -d /sys/firmware/efi ]; then
|
||||
echo "BOOT MODE: UEFI"
|
||||
IMG_URL="https://github.com/elseif/MikroTikPatch/releases/download/$LATEST_VERSION/chr-$LATEST_VERSION.img.zip"
|
||||
else
|
||||
echo "BOOT MODE: BIOS/MBR"
|
||||
IMG_URL="https://github.com/elseif/MikroTikPatch/releases/download/$LATEST_VERSION/chr-$LATEST_VERSION-legacy-bios.img.zip"
|
||||
fi
|
||||
;;
|
||||
aarch64)
|
||||
echo "ARCH: $ARCH"
|
||||
IMG_URL="https://github.com/elseif/MikroTikPatch/releases/download/$LATEST_VERSION-arm64/chr-$LATEST_VERSION-arm64.img.zip"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported architecture: $ARCH"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
case $ARCH in
|
||||
x86_64|i386|i486|i586|i686)
|
||||
echo "ARCH: $ARCH"
|
||||
IMG_URL="https://github.com/elseif/MikroTikPatch/releases/download/$LATEST_VERSION/chr-$LATEST_VERSION.img.zip"
|
||||
else
|
||||
echo "BOOT MODE: BIOS/MBR"
|
||||
IMG_URL="https://github.com/elseif/MikroTikPatch/releases/download/$LATEST_VERSION/chr-$LATEST_VERSION-legacy-bios.img.zip"
|
||||
fi
|
||||
;;
|
||||
aarch64)
|
||||
echo "ARCH: $ARCH"
|
||||
IMG_URL="https://github.com/elseif/MikroTikPatch/releases/download/$LATEST_VERSION-arm64/chr-$LATEST_VERSION-arm64.img.zip"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported architecture: $ARCH"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported architecture: $ARCH"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
STORAGE=$(lsblk -d -n -o NAME,TYPE | awk '$2=="disk"{print $1; exit}')
|
||||
echo "STORAGE: $STORAGE"
|
||||
ETH=$(ip route show default | grep '^default' | sed -n 's/.* dev \([^\ ]*\) .*/\1/p')
|
||||
|
||||
@@ -847,7 +847,7 @@
|
||||
function updateCommand(version) {
|
||||
const tool = document.querySelector('input[name="tool"]:checked').value;
|
||||
let cmd;
|
||||
const proxy = `${localStorage.getItem("gh-proxy-enabled") === "true"?" | sed 's#https://github.com#https:/gh-proxy.com/https://github.com#g'":""}`;
|
||||
const proxy = `${localStorage.getItem("gh-proxy-enabled") === "true"?" | sed 's#https://github.com#https://gh-proxy.com/https://github.com#g'":""}`;
|
||||
if (tool === "curl") {
|
||||
cmd = `<pre ${proxy === ""?"":"style='font-size:12px'"}><span class="bash">curl</span> <span class="url">https://mikrotik.ltd/chr.sh</span>${proxy} | <span class="bash">bash</span> -s <span class="version">${version}</span></pre>`;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user