diff --git a/ext/openwrt/scripts/easycwmp.sh b/ext/openwrt/scripts/easycwmp.sh index e242fda..1ff583a 100755 --- a/ext/openwrt/scripts/easycwmp.sh +++ b/ext/openwrt/scripts/easycwmp.sh @@ -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