Your Name 3 years ago
parent
commit
8030ce8bca
1 changed files with 8 additions and 5 deletions
  1. 8 5
      upload_mega.sh

+ 8 - 5
upload_mega.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 set -e
 version=4.4
-date=20/01/2021
+date=03/05/2021
 pixz_i=""
 pigz_i=""
 swap_was="0"
@@ -10,7 +10,7 @@ pv_i=0
 cifs_i=0
 retry_flag=0
 daemon_on=0
-split_size=512
+split_size=400
 
 echo -e "\e[97mOkcash Blockchain Uploader v$version ($date)\e[0m"
 echo -e "Update for Mega.io."
@@ -60,13 +60,12 @@ if ! [ -x "$(command -v lftp)" ]; then ftp_i="lftp" && echo -e "[\e[91m NO  \e[0
 echo -e -n "Check PV    installed  : "
 if ! [ -x "$(command -v pv)" ]; then pv_i="pv" && echo -e "[\e[91m NO  \e[0m]"; else pv_i="" && echo -e "[\e[92m YES \e[0m]"; fi
 echo -e -n "Check CIFS  installed  : "
-if ! [ -x "$(command -v mount.cifs)" ]; then cifs_i="cifs-utils" && echo -e "[\e[91m NO  \e[0m]"; else cifs_i="" && echo -e "[\e[92m YES \e[0m]"; fi
-if [[ ! $ftp_i = "" || ! $pixz_i = "" || ! $pv_i = "" || ! $pigz_i = "" || !$cifs_i = "" ]]
+if ! [ -x "$(command -v cifscreds)" ]; then cifs_i="cifs-utils" && echo -e "[\e[91m NO  \e[0m]"; else cifs_i="" && echo -e "[\e[92m YES \e[0m]"; fi
+if [[ ! $ftp_i = "" || ! $pixz_i = "" || ! $pv_i = "" || ! $pigz_i = "" || ! $cifs_i = "" ]]
 then
 echo -e "\n\e[95mSoftwares update & install :\e[0m"
 sudo apt-get update
 sudo apt install $pixz_i $ftp_i $pv_i $lrzip_i $pigz_i $cifs_i -y
-sleep 1
 check_software_
 fi
 echo -e "Done."
@@ -214,6 +213,10 @@ if [ -f bootstrap06.md5 ];then ftp_file=bootstrap06.md5 && ftp_loop ;fi
 if [ -f bootstrap07.md5 ];then ftp_file=bootstrap07.md5 && ftp_loop ;fi
 echo -e "\n\e[95mUpload files to Freebox :\e[0m"
 if ! [ -d /tmp/bootstrap ]; then mkdir /tmp/bootstrap ;fi
+if mount | grep -i "//mafreebox.freebox.fr/" >/dev/null
+then
+sudo umount /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.part* /tmp/bootstrap/bootstrap/