加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ddwrt-gui-extract.sh 901 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
OUT="$1"
DIR="$2"
if [ "$DIR" == "" ]
then
DIR="fmk/rootfs"
fi
if [ "$OUT" == "" ]
then
OUT="www"
fi
if [ $UID -ne 0 ]
then
SUDO="sudo"
fi
eval $(cat shared-ng.inc)
HTTPD="$DIR/usr/sbin/httpd"
WWW="$DIR/etc/www"
KEYFILE="$DIR/webcomp.key"
echo -e "Firmware Mod Kit (ddwrt-gui-extract) $VERSION, (c)2013 Craig Heffner, Jeremy Collake\nhttp://www.bitsum.com\n"
if [ ! -d "$DIR" ] || [ "$1" == "-h" ] || [ "$1" == "--help" ]
then
echo -e "Usage: $0 [output directory] [rootfs directory]\n"
exit 1
fi
if [ ! -e "$HTTPD" ] || [ ! -e "$WWW" ]
then
echo "Unable to locate httpd / www files in directory $DIR. Quitting..."
exit 1
fi
# Extract!
# key file is written to rootfs, and since may have root ownership, sudo
TMPFILE=`mktemp /tmp/$0.XXXXXX`
./src/webcomp-tools/webdecomp --httpd="$HTTPD" --www="$WWW" --dir="$OUT" --key="$TMPFILE" --extract
$SUDO cp "$TMPFILE" "$KEYFILE"
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化