Browse Source

update for mega

Your Name 3 years ago
parent
commit
dfaf7be9df
1 changed files with 40 additions and 8 deletions
  1. 40 8
      upload_mega.sh

+ 40 - 8
upload_mega.sh

@@ -10,6 +10,8 @@ pv_i=0
 cifs_i=0
 retry_flag=0
 daemon_on=0
+split_size=500
+
 echo -e "\e[97mOkcash Blockchain Uploader v$version ($date)\e[0m"
 echo -e "Update for Mega.io...WIP"
 echo -e "wareck : wareck@gmail.com"
@@ -135,18 +137,44 @@ tar cf - .okcash/txleveldb/* .okcash/blk0001.dat | pv -s ${SIZE}k | pixz  > boot
 sleep 1
 echo "Done."
 
+echo -e "\n\e[95mSplitting Files (${split_size}M):\e[0m"
+split --verbose -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
+
 echo -e "\n\e[95mMake bootstrap_v.txt:\e[0m"
 Raw_date="`date +%d.%m.%Y`"
+YYYY=`ls -l bootstrap*.part* | wc -l`
 cat <<'EOF'>> bootstrap_v.txt
 Bootstrap : XXXX
-Compressed with :  tar / xz
-Link :
+Parts: YYYY
+Link1 :
+link2 :
+link3 :
+link4 :
+link5 :
+link6 :
 EOF
 sed -i -e "s/XXXX/$Raw_date/g" bootstrap_v.txt
+sed -i -e "s/YYYY/$YYYY/g" bootstrap_v.txt
 echo "Done."
 
 echo -e "\n\e[95mMd5sum Files:\e[0m"
-if [ -f bootstrap.tar.xz ]; then echo -e -n "md5sum Bootstrap.tar.xz: " && md5sum bootstrap.tar.xz > bootstrap.md5 && echo -e "\e[1mDone.\e[0m"; fi
+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
 touch /home/$USER/bootstrap_uploadpass
 }
 
@@ -174,16 +202,20 @@ 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 bootstrap.md5 ];then ftp_file=bootstrap.md5 && 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
+echo -e "\n\e[95mUpload files to Freebox :\e[0m"
 if ! [ -d /tmp/bootstrap ]; then mkdir /tmp/bootstrap ;fi
 sudo mount -t cifs //mafreebox.freebox.fr/Disque\ dur/  /tmp/bootstrap/ -o user=freebox,password=password,uid=1000,gid=1000,rw,vers=1.0
 if ! [ -d /tmp/bootstrap/bootstrap ]; then mkdir /tmp/bootstrap/bootstrap ;fi
-cp -v bootstrap.tar.xz /tmp/bootstrap/bootstrap/
+cp -v bootstrap.part* /tmp/bootstrap/bootstrap/
 cp -v bootstrap_v.txt /tmp/bootstrap/bootstrap/
-cp -v bootstrap.md5 /tmp/bootstrap/bootstrap/
+cp -v bootstrap*.md5 /tmp/bootstrap/bootstrap/
 sleep 5
 sudo umount /tmp/bootstrap