1
0
This repository has been archived on 2025-01-10. You can view files and clone it, but cannot push or open issues or pull requests.
2018-02-17 18:30:59 -02:00

31 lines
435 B
Bash
Executable File

#!/bin/bash
FNAME=$1
ROUTERIP=$2
USERNAME=$3
if [ -z "$FNAME" ]
then
echo "usage: $0 firmware.bin [routerip] [username]"
exit 1
fi
if [ ! -f "$FNAME" ]
then
echo "ERROR: $FNAME doesn't exist"
exit 1
fi
if [ -z "$ROUTERIP" ]
then
ROUTERIP='192.168.25.1'
fi
if [ ! -z "$USERNAME" ]
then
USERNAME="--digest --user $USERNAME"
fi
curl -H "Expect:" "http://${ROUTERIP}/cgi-bin/firmware.cgi" -F sFirmwareFile=@"$FNAME" $USERNAME