Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ BOOT_OPTS+=" -device isa-applesmc,osk=$osk"
# OVMF
DEST="$STORAGE/$DEST"

if [ ! -s "$DEST.rom" ] || [ ! -f "$DEST.rom" ]; then
[ ! -s "$OVMF/$ROM" ] || [ ! -f "$OVMF/$ROM" ] && error "UEFI boot file ($OVMF/$ROM) not found!" && exit 44
if [ ! -s "$DEST.rom" || ! -f "$DEST.rom" ]; then
[ ! -s "$OVMF/$ROM" || ! -f "$OVMF/$ROM" ] && error "UEFI boot file ($OVMF/$ROM) not found!" && exit 44
cp "$OVMF/$ROM" "$DEST.rom"
fi

if [ ! -s "$DEST.vars" ] || [ ! -f "$DEST.vars" ]; then
[ ! -s "$OVMF/$VARS" ] || [ ! -f "$OVMF/$VARS" ]&& error "UEFI vars file ($OVMF/$VARS) not found!" && exit 45
if [ ! -s "$DEST.vars" || ! -f "$DEST.vars" ]; then
[ ! -s "$OVMF/$VARS" || ! -f "$OVMF/$VARS" ]&& error "UEFI vars file ($OVMF/$VARS) not found!" && exit 45
cp "$OVMF/$VARS" "$DEST.vars"
fi

Expand All @@ -73,7 +73,7 @@ if [ ! -f "$IMG" ]; then

[ ! -f "$ISO" ] && gzip -dk "$ISO.gz"

if [ ! -f "$ISO" ] || [ ! -s "$ISO" ]; then
if [ ! -f "$ISO" || ! -s "$ISO" ]; then
error "Could not find image file \"$ISO\"." && exit 10
fi

Expand Down
10 changes: 5 additions & 5 deletions src/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function download() {
downloadLink=$(echo "$info" | grep 'oscdn' | grep 'dmg')
downloadSession=$(echo "$info" | grep 'expires' | grep 'dmg')

if [ -z "$downloadLink" ] || [ -z "$downloadSession" ]; then
if [ -z "$downloadLink" || -z "$downloadSession" ]; then

local code="99"
msg="Failed to connect to the Apple servers, reason:"
Expand Down Expand Up @@ -201,12 +201,12 @@ generateSerial() {
local file="$STORAGE/$PROCESS.sn"
local file2="$STORAGE/$PROCESS.mlb"

[ -n "$SN" ] && [ -n "$MLB" ] && return 0
[ -n "$SN" && -n "$MLB" ] && return 0
[ -s "$file" ] && SN=$(<"$file")
[ -s "$file2" ] && MLB=$(<"$file2")
SN="${SN//[![:print:]]/}"
MLB="${MLB//[![:print:]]/}"
[ -n "$SN" ] && [ -n "$MLB" ] && return 0
[ -n "$SN" && -n "$MLB" ] && return 0

# Generate unique serial numbers for machine
SN=$(/usr/local/bin/macserial --num 1 --model "${MODEL}" 2>/dev/null)
Expand Down Expand Up @@ -238,12 +238,12 @@ if [ -z "$VERSION" ]; then

fi

if [ ! -f "$BASE_IMG" ] || [ ! -s "$BASE_IMG" ]; then
if [ ! -f "$BASE_IMG" || ! -s "$BASE_IMG" ]; then

STORAGE="$STORAGE/${VERSION,,}"
BASE_IMG="$STORAGE/base.dmg"

if [ ! -f "$BASE_IMG" ] || [ ! -s "$BASE_IMG" ]; then
if [ ! -f "$BASE_IMG" || ! -s "$BASE_IMG" ]; then
! install "$VERSION" "$BASE_IMG" && exit 34
fi

Expand Down
Loading