Pārlūkot izejas kodu

低配增量升级脚本

liyi 11 mēneši atpakaļ
vecāks
revīzija
e18e45f34f
1 mainītis faili ar 58 papildinājumiem un 3 dzēšanām
  1. 58 3
      output/t113s/push/tools/script_retain.sh

+ 58 - 3
output/t113s/push/tools/script_retain.sh

@@ -49,11 +49,66 @@ kill_all
 #rm_old
 
 cd /mnt/UDISK
-rm -rf web fw
-find app -type f \( -not -name "*.db" -and -not -name "*.ini" \) -exec rm -f {} +
+
+
+#rm -rf web fw
+
+mkdir -p /tmp/upgrade
 
 echo release $obj
-tar -zxkf  $obj  -C  /  >/dev/null  2>&1
+
+tar -zxvf  $obj  -C  /tmp/upgrade  > /dev/null  2>&1
+
+cd /tmp/upgrade
+
+find /tmp/upgrade -type f  > /tmp/upgrade.log
+
+
+
+
+
+PORT_FILE="/tmp/upgrade/mnt/UDISK/app/smartPDU_PhList.ini /tmp/upgrade/mnt/UDISK/app/smartPDU.ini /tmp/upgrade/mnt/UDISK/app/pdu_dat.db /tmp/upgrade/mnt/UDISK/app/pdu_dat_bak.db"
+
+no_cp_flag=0
+
+while IFS= read -r line; do
+  flag=0
+  for n in $PORT_FILE
+  do
+    if [[ $n == $line ]];then
+      no_cp_flag=1
+      break;
+    fi
+  done
+  if [[ $no_cp_flag -ne 1 ]]; then
+    #echo $line
+	detection="${line:12}"
+    dir=`/usr/bin/dirname $detection`
+	if [[ ! -d $dir ]];then
+		mkdir -p $dir
+	fi
+    #cp file to dir
+	cp $line  $detection
+	echo "cp $line  $detection"
+  fi
+
+done < /tmp/upgrade.log
+
+
+
+#delete file upgrade 
+
+rm -rf /tmp/upgrade/*
+
+rm /tmp/upgrade.log
+
+
+
+
+cd /mnt/UDISK
+
+
+#delete obj
 rm -f  $obj