38 lines
867 B
Bash
Executable File
38 lines
867 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# tar -zcf - update1.sh Payload_SDK_V2.2.1_300tc ximeaControlDll ximeaAirborneSystem | openssl des3 -salt -k irishk******* | dd of=source.des3
|
|
|
|
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 irishk*******|tar zxf - -C $uncompressDir
|
|
rm $updateSource
|
|
|
|
cd $uncompressDir
|
|
|
|
chmod +x update1.sh
|
|
sh update1.sh
|
|
fi
|
|
|