mirror of
https://github.com/LongQT-sea/OpenCore-ISO
synced 2026-11-26 09:18:20 +08:00
fix: handle TLS issues on older macOS when downloading mkmaciso
This commit is contained in:
1 file changed
+10
-5
@@ -1,19 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
# Simple launcher for mkmaciso
|
||||
set -e
|
||||
|
||||
MKMACISO_URL="https://raw.githubusercontent.com/LongQT-sea/mkmaciso/main/mkmaciso"
|
||||
LOCAL_BIN="$HOME/.local/bin"
|
||||
TARGET="$LOCAL_BIN/mkmaciso"
|
||||
EXPORT_LINE='export PATH="$HOME/.local/bin:$PATH"'
|
||||
|
||||
# Check kernel version and set curl options accordingly
|
||||
KERNEL_VERSION=$(uname -r | cut -d. -f1)
|
||||
if [[ "$KERNEL_VERSION" -ge 15 ]]; then
|
||||
CURL_OPTS="-fsSL"
|
||||
else
|
||||
CURL_OPTS="-fsSL --insecure"
|
||||
fi
|
||||
|
||||
# Install mkmaciso if missing
|
||||
if [[ ! -f "$TARGET" ]]; then
|
||||
mkdir -p "$LOCAL_BIN"
|
||||
curl -fsSL "$MKMACISO_URL" -o "$TARGET"
|
||||
curl $CURL_OPTS "$MKMACISO_URL" -o "$TARGET"
|
||||
chmod +x "$TARGET"
|
||||
fi
|
||||
|
||||
# Ensure ~/.local/bin is in PATH
|
||||
if [[ ":$PATH:" != *":$LOCAL_BIN:"* ]]; then
|
||||
case "$SHELL" in
|
||||
@@ -25,5 +31,4 @@ if [[ ":$PATH:" != *":$LOCAL_BIN:"* ]]; then
|
||||
touch "$RC"
|
||||
grep -qxF "$EXPORT_LINE" "$RC" || printf '\n%s\n' "$EXPORT_LINE" >> "$RC"
|
||||
fi
|
||||
|
||||
exec "$TARGET" "$@"
|
||||
exec "$TARGET" "$@"
|
||||
Reference in new issue
Block a user