config file can be uploaded with this script, too
This commit is contained in:
parent
2e77516d43
commit
7939bf578d
@ -37,11 +37,13 @@ else
|
|||||||
FILES=$2
|
FILES=$2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Generate DIET version of the files"
|
# Convert files, if necessary
|
||||||
OUTFILES=""
|
if [ "$FILES" != "config.lua" ]; then
|
||||||
ROOTDIR=$PWD
|
echo "Generate DIET version of the files"
|
||||||
cd $TOOLDIR
|
OUTFILES=""
|
||||||
for f in $FILES; do
|
ROOTDIR=$PWD
|
||||||
|
cd $TOOLDIR
|
||||||
|
for f in $FILES; do
|
||||||
if [[ "$f" == *.lua ]] && [[ "$f" != init.lua ]]; then
|
if [[ "$f" == *.lua ]] && [[ "$f" != init.lua ]]; then
|
||||||
echo "Compress $f ..."
|
echo "Compress $f ..."
|
||||||
out=$(echo "$f" | sed 's/.lua/_diet.lua/g')
|
out=$(echo "$f" | sed 's/.lua/_diet.lua/g')
|
||||||
@ -50,9 +52,20 @@ for f in $FILES; do
|
|||||||
else
|
else
|
||||||
OUTFILES="$OUTFILES $f"
|
OUTFILES="$OUTFILES $f"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
FILES=$OUTFILES
|
FILES=$OUTFILES
|
||||||
cd $ROOTDIR
|
cd $ROOTDIR
|
||||||
|
fi
|
||||||
|
echo "Reboot ESP and stop init timer"
|
||||||
|
if [ ! -f $LUASCRIPT_STOP ]; then
|
||||||
|
echo "Cannot find $LUASCRIPT_STOP"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
python3 $LUATOOL -p $DEVICE -f $LUASCRIPT_STOP -b $BAUD --volatile --delay 2
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Could not reboot"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $# -eq 1 ]; then
|
if [ $# -eq 1 ]; then
|
||||||
# Format filesystem first
|
# Format filesystem first
|
||||||
@ -62,17 +75,6 @@ if [ $# -eq 1 ]; then
|
|||||||
echo "STOOOOP"
|
echo "STOOOOP"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
echo "Reboot ESP and stop init timer"
|
|
||||||
if [ ! -f $LUASCRIPT_STOP ]; then
|
|
||||||
echo "Cannot find $LUASCRIPT_STOP"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
python3 $LUATOOL -p $DEVICE -f $LUASCRIPT_STOP -b $BAUD --volatile --delay 2
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "Could not reboot"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Start Flasing ..."
|
echo "Start Flasing ..."
|
||||||
|
Loading…
Reference in New Issue
Block a user