Skip to content

Commit

Permalink
#0000203: Support tar.gz file of luci in the apply download of config
Browse files Browse the repository at this point in the history
  • Loading branch information
fbesbes committed Feb 16, 2017
1 parent 8f85cdf commit 4915cb1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ext/openwrt/scripts/easycwmp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,21 @@ handle_action() {
tar -zxf $dwfile -C $DOWNLOAD_DIR >/dev/null 2>&1
fault_code="$?"
if [ "$fault_code" = "0" ]; then
cp $DOWNLOAD_DIR/config/* /etc/config/
if [ -d $ $DOWNLOAD_DIR/config/ ]
cp -R $DOWNLOAD_DIR/config/* /etc/config/
else
cp -R $DOWNLOAD_DIR/* /
fi
fi
elif [ ${dwfile%.bz2} != $dwfile ]; then
tar -jxf $dwfile -C $DOWNLOAD_DIR >/dev/null 2>&1
fault_code="$?"
if [ "$fault_code" = "0" ]; then
cp $DOWNLOAD_DIR/config/* /etc/config/
if [ -d $ $DOWNLOAD_DIR/config/ ]
cp -R $DOWNLOAD_DIR/config/* /etc/config/
else
cp -R $DOWNLOAD_DIR/* /
fi
fi
else
/sbin/uci import < $dwfile
Expand Down

0 comments on commit 4915cb1

Please sign in to comment.