Your Name 3 years ago
parent
commit
3f7a424776
2 changed files with 21 additions and 43 deletions
  1. 6 6
      upload_bootstrap.sh
  2. 15 37
      upload_mega.sh

+ 6 - 6
upload_bootstrap.sh

@@ -136,7 +136,7 @@ tar cf - .okcash/txleveldb/* .okcash/blk0001.dat | pv -s ${SIZE}k | pixz  > boot
 sleep 1
 
 echo -e "\n\e[95mSplitting Files (${split_size}M):\e[0m"
-split --verbose -d -b ${split_size}M bootstrap.tar.xz "bootstrap.part"
+split --verbose --numeric-suffixes=1 -b ${split_size}M bootstrap.tar.xz "bootstrap.part"
 rm bootstrap.tar.xz
 sleep 1
 echo "Done."
@@ -155,8 +155,8 @@ echo "Done."
 
 echo -e "\n\e[95mMd5sum Files:\e[0m"
 zap=$(ls -l bootstrap.part* | wc -l)
-zap=$((zap-1))
-for i in `seq -w 00 $zap`
+#zap=$((zap-1))
+for i in `seq -w 01 $zap`
 do
 echo -e -n "md5sum Bootstrap.part$i: " && md5sum bootstrap.part$i > bootstrap$i.md5 && echo -e "\e[1mDone.\e[0m"
 done
@@ -189,15 +189,15 @@ cd /home/$USER
 echo -e "\n\e[95mUpload files to server :\e[0m"
 ftp_file=bootstrap_v.txt && ftp_loop
 zap=$(ls -l bootstrap.part* | wc -l)
-zap=$((zap-1))
-for i in `seq -w 00 $zap`
+#zap=$((zap-1))
+for i in `seq -w 01 $zap`
 do
 ftp_file=bootstrap.part$i
 ftp_loop
 done
 sleep 3
 
-for j in `seq -w 00 $zap`
+for j in `seq -w 01 $zap`
 do
 ftp_file=bootstrap$j.md5
 ftp_loop

+ 15 - 37
upload_mega.sh

@@ -10,10 +10,10 @@ pv_i=0
 cifs_i=0
 retry_flag=0
 daemon_on=0
-split_size=850
+split_size=700
 
 echo -e "\e[97mOkcash Blockchain Uploader v$version ($date)\e[0m"
-echo -e "Update for Mega.io."
+echo -e "Update for Mega.io. upload"
 echo -e "wareck : wareck@gmail.com"
 echo -e ""
 sleep 2
@@ -137,24 +137,11 @@ sleep 1
 echo "Done."
 
 echo -e "\n\e[95mSplitting Files (${split_size}M):\e[0m"
-split --verbose -d -b ${split_size}M bootstrap.tar.xz "bootstrap.part"
+split --verbose --numeric-suffixes=1 -b ${split_size}M bootstrap.tar.xz "bootstrap.part"
 rm bootstrap.tar.xz
 sleep 1
 echo "Done."
 
-echo -e "\n\e[95mRename Files:\e[0m"
-if [ -f bootstrap.partaa ]; then mv bootstrap.partaa bootstrap.part01 && echo "bootstrap.partaa >> bootstrap.part01" ;fi
-if [ -f bootstrap.partab ]; then mv bootstrap.partab bootstrap.part02 && echo "bootstrap.partab >> bootstrap.part02" ;fi
-if [ -f bootstrap.partac ]; then mv bootstrap.partac bootstrap.part03 && echo "bootstrap.partac >> bootstrap.part03" ;fi
-if [ -f bootstrap.partad ]; then mv bootstrap.partad bootstrap.part04 && echo "bootstrap.partad >> bootstrap.part04" ;fi
-if [ -f bootstrap.partae ]; then mv bootstrap.partae bootstrap.part05 && echo "bootstrap.partae >> bootstrap.part05" ;fi
-if [ -f bootstrap.partaf ]; then mv bootstrap.partaf bootstrap.part06 && echo "bootstrap.partaf >> bootstrap.part06" ;fi
-if [ -f bootstrap.partag ]; then mv bootstrap.partag bootstrap.part07 && echo "bootstrap.partag >> bootstrap.part07" ;fi
-if [ -f bootstrap.partah ]; then mv bootstrap.partah bootstrap.part08 && echo "bootstrap.partah >> bootstrap.part08" ;fi
-if [ -f bootstrap.partai ]; then mv bootstrap.partai bootstrap.part09 && echo "bootstrap.partai >> bootstrap.part09" ;fi
-if [ -f bootstrap.partaj ]; then mv bootstrap.partai bootstrap.part10 && echo "bootstrap.partai >> bootstrap.part10" ;fi
-
-
 echo -e "\n\e[95mMake bootstrap_v.txt:\e[0m"
 Raw_date="`date +%d.%m.%Y`"
 YYYY=`ls -l bootstrap*.part* | wc -l`
@@ -167,16 +154,11 @@ sed -i -e "s/YYYY/$YYYY/g" bootstrap_v.txt
 echo "Done."
 
 echo -e "\n\e[95mMd5sum Files:\e[0m"
-if [ -f bootstrap.part01 ]; then echo -e -n "md5sum Bootstrap.part01: " && md5sum bootstrap.part01 > bootstrap01.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part02 ]; then echo -e -n "md5sum Bootstrap.part02: " && md5sum bootstrap.part02 > bootstrap02.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part03 ]; then echo -e -n "md5sum Bootstrap.part03: " && md5sum bootstrap.part03 > bootstrap03.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part04 ]; then echo -e -n "md5sum Bootstrap.part04: " && md5sum bootstrap.part04 > bootstrap04.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part05 ]; then echo -e -n "md5sum Bootstrap.part05: " && md5sum bootstrap.part05 > bootstrap05.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part06 ]; then echo -e -n "md5sum Bootstrap.part06: " && md5sum bootstrap.part06 > bootstrap06.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part07 ]; then echo -e -n "md5sum Bootstrap.part07: " && md5sum bootstrap.part07 > bootstrap07.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part08 ]; then echo -e -n "md5sum Bootstrap.part08: " && md5sum bootstrap.part08 > bootstrap08.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part09 ]; then echo -e -n "md5sum Bootstrap.part09: " && md5sum bootstrap.part09 > bootstrap09.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part10 ]; then echo -e -n "md5sum Bootstrap.part10: " && md5sum bootstrap.part10 > bootstrap10.md5 && echo -e "\e[1mDone.\e[0m"; fi
+zap=$(ls -l bootstrap.part* | wc -l)
+for i in `seq -w 01 $zap`
+do
+echo -e -n "md5sum Bootstrap.part$i: " && md5sum bootstrap.part$i > bootstrap$i.md5 && echo -e "\e[1mDone.\e[0m"
+done
 touch /home/$USER/bootstrap_uploadpass
 }
 
@@ -204,17 +186,13 @@ echo -n $ftp_file && echo -e ": \e[1mDone.\e[0m";
 function upload {
 cd /home/$USER
 echo -e "\n\e[95mUpload files to server :\e[0m"
-if [ -f bootstrap_v.txt ];then ftp_file=bootstrap_v.txt && ftp_loop ;fi
-if [ -f bootstrap01.md5 ];then ftp_file=bootstrap01.md5 && ftp_loop ;fi
-if [ -f bootstrap02.md5 ];then ftp_file=bootstrap02.md5 && ftp_loop ;fi
-if [ -f bootstrap03.md5 ];then ftp_file=bootstrap03.md5 && ftp_loop ;fi
-if [ -f bootstrap04.md5 ];then ftp_file=bootstrap04.md5 && ftp_loop ;fi
-if [ -f bootstrap05.md5 ];then ftp_file=bootstrap05.md5 && ftp_loop ;fi
-if [ -f bootstrap06.md5 ];then ftp_file=bootstrap06.md5 && ftp_loop ;fi
-if [ -f bootstrap07.md5 ];then ftp_file=bootstrap07.md5 && ftp_loop ;fi
-if [ -f bootstrap08.md5 ];then ftp_file=bootstrap08.md5 && ftp_loop ;fi
-if [ -f bootstrap09.md5 ];then ftp_file=bootstrap09.md5 && ftp_loop ;fi
-if [ -f bootstrap10.md5 ];then ftp_file=bootstrap09.md5 && ftp_loop ;fi
+ftp_file=bootstrap_v.txt && ftp_loop
+zap=$(ls -l bootstrap.part* | wc -l)
+for j in `seq -w 01 $zap`
+do
+ftp_file=bootstrap$j.md5
+ftp_loop
+done
 
 echo -e "\n\e[95mUpload files to Freebox :\e[0m"
 if ! [ -d /tmp/bootstrap ]; then mkdir /tmp/bootstrap ;fi