Skip to content

Commit

Permalink
- Docker: Firmware version passed as argument or default to 1100
Browse files Browse the repository at this point in the history
  • Loading branch information
SoftwareRat committed Sep 8, 2024
1 parent 74b4da9 commit 5a3eb06
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions docker/start.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
#!/bin/bash

# Set default firmware version if not provided
FIRMWARE_VERSION="${FIRMWARE_VERSION:-1100}"
# Firmware version passed as argument or default to 1100
FIRMWARE_VERSION=${1:-1100}

# Download the correct stage1 and stage2 binaries for the firmware version
echo "Downloading firmware binaries for version ${FIRMWARE_VERSION}..."
wget -q https://github.com/B-Dem/PPPwnUI/raw/main/PPPwn/goldhen/${FIRMWARE_VERSION}/stage1.bin
wget -q https://github.com/B-Dem/PPPwnUI/raw/main/PPPwn/goldhen/${FIRMWARE_VERSION}/stage2.bin
# Download the firmware binaries
echo "Downloading firmware binaries for version $FIRMWARE_VERSION..."
wget -q -P /opt/pppwn https://github.com/B-Dem/PPPwnUI/raw/main/PPPwn/goldhen/${FIRMWARE_VERSION}/stage1.bin
wget -q -P /opt/pppwn https://github.com/B-Dem/PPPwnUI/raw/main/PPPwn/goldhen/${FIRMWARE_VERSION}/stage2.bin

if [ ! -f "stage1.bin" ] || [ ! -f "stage2.bin" ]; then
echo "Error: Failed to download firmware binaries for version ${FIRMWARE_VERSION}"
# Check if the files were downloaded correctly
if [ ! -f "/opt/pppwn/stage1.bin" ] || [ ! -f "/opt/pppwn/stage2.bin" ]; then
echo "Error: Failed to download firmware binaries for version $FIRMWARE_VERSION"
exit 1
fi

# Run the PPPwn++ binary with the correct firmware version and downloaded stages
/opt/pppwn/pppwn -i eth0 --fw "$FIRMWARE_VERSION" --stage1 /opt/pppwn/stage1.bin --stage2 /opt/pppwn/stage2.bin -a
# Run PPPwn++
/opt/pppwn/pppwn -i eth0 --fw $FIRMWARE_VERSION --stage1 /opt/pppwn/stage1.bin --stage2 /opt/pppwn/stage2.bin -a

0 comments on commit 5a3eb06

Please sign in to comment.