1. remove source code;2. update;

This commit is contained in:
Tangchao
2023-06-11 17:42:42 +08:00
parent 1c2ac044e6
commit 348fdff5f9
3 changed files with 124 additions and 0 deletions

35
update0.sh Normal file
View File

@ -0,0 +1,35 @@
#!/bin/bash
makeEmptyDIR()
{
if [ ! -e $1 ]; then
# echo "$1 do not exist!"
mkdir -p $1
elif [ -e $1 ] && [ ! "$(ls -A $1)" ]; then
# echo "$1 exist and null!"
a=1
elif [ -e $1 ] && [ "$(ls -A $1)" ]; then
# echo "$1 exist but not null!"
cd $1
rm -r *
fi
}
uncompressDir=/home/300tc/source_update_tmp
makeEmptyDIR $uncompressDir
updateSource=/media/nvme/300TC/update/source*
boolSource=`ls -l $updateSource | wc -l`
if [ ! $boolSource -eq 0 ] ; then
temp=$(ls $updateSource)
dd if=$temp | openssl des3 -d -k 123456|tar zxf - -C $uncompressDir
rm $updateSource
cd $uncompressDir
chmod +x update1.sh
sh update1.sh
fi