|
2012-11-11
, 15:00
|
Posts: 299 |
Thanked: 557 times |
Joined on Aug 2012
|
#4592
|
brkn, i have another little question..
In option C user can download both instruction (Russian and English). Instead creating two scripts, how i can edit your script for downloading both files?
Thanks.
EDIT:
I just added the second script with another link below the first one, all in to one script, maybe it not right, but it work
#!/bin/bash bar="========================================" barlength=${#bar} FOLDER="https://dl.dropbox.com/u/17706605" FILE[0]="N9_QuickTweak_en_v9.4.pdf" FILE[1]="N9_QuickTweak_ru_v9.4.pdf" echo "Calculating download size ..." for (( i = 0 ; i < ${#FILE[@]} ; i++ )) do if [ -f "${FILE[$i]}" ] ; then rm -f "${FILE[$i]}" ; fi length=$(wget "$FOLDER/${FILE[$i]}" --spider --server-response -O - 2>&1 | sed -ne '/Content-Length/{s/.*: //;p}') totallength=$(($totallength + $length)) touch "${FILE[$i]}" nice -n 19 wget -N -q "$FOLDER/${FILE[$i]}" 2>/dev/null & done echo "Downloading $totallength bytes" tmp=1 totaltmp=1 while [[ $totaltmp -lt $totallength ]]; do tmp1=$(stat "${FILE[0]}" | grep Size | awk '{print $2}') tmp2=$(stat "${FILE[1]}" | grep Size | awk '{print $2}') totaltmp=$(($tmp1 + $tmp2)) n=$(($totaltmp * $barlength / $totallength)) percent=$((100 * $totaltmp / $totallength)) printf "\r[%-${barlength}s]" "${bar:0:n}" printf " $percent%%" sleep 0.1 done printf "\n"
The Following User Says Thank You to brkn For This Useful Post: | ||
|
2012-11-11
, 15:06
|
Posts: 208 |
Thanked: 63 times |
Joined on May 2012
|
#4593
|
|
2012-11-11
, 15:08
|
Moderator |
Posts: 6,215 |
Thanked: 6,400 times |
Joined on Nov 2011
|
#4594
|
The Following User Says Thank You to thedead1440 For This Useful Post: | ||
|
2012-11-11
, 15:12
|
Posts: 208 |
Thanked: 63 times |
Joined on May 2012
|
#4595
|
|
2012-11-11
, 15:17
|
|
Posts: 5,339 |
Thanked: 4,133 times |
Joined on Jan 2010
@ Israel
|
#4596
|
! Downloading PDF instruction... Calculating download size ... /opt/N9QTweak/Tweaks/downloader.sh: line 15: +: syntax error: operand expected (error token is "+ ") PDF instruction downloaded successfully...
|
2012-11-11
, 16:40
|
Posts: 299 |
Thanked: 557 times |
Joined on Aug 2012
|
#4597
|
|
2012-11-11
, 17:41
|
|
Posts: 5,339 |
Thanked: 4,133 times |
Joined on Jan 2010
@ Israel
|
#4598
|
bash /opt/N9QTweak/Tweaks/downloader.sh
|
2012-11-11
, 17:44
|
Posts: 299 |
Thanked: 557 times |
Joined on Aug 2012
|
#4599
|
Now it's correct
But the same errorCode:bash /opt/N9QTweak/Tweaks/downloader.sh
The Following User Says Thank You to brkn For This Useful Post: | ||
|
2012-11-11
, 17:51
|
|
Posts: 5,339 |
Thanked: 4,133 times |
Joined on Jan 2010
@ Israel
|
#4600
|
Tell me if you want it dynamic for pushing in more than 2 files or is it ok like this? Do you need the landscape mod?
Else my work is done here...
Tags |
hebrew vkb, n9 qtweak, n9 quick tweak, n9 quicktweak, root-ssh |
Thread Tools | |
|
In option C user can download both instruction (Russian and English). Instead creating two scripts, how i can edit your script for downloading both files?
Thanks.
EDIT:
I just added the second script with another link below the first one, all in to one script, maybe it not right, but it work
Lausanne & Lyon de descente...
----------------
Schturman's home page
Schturman's repo on openrepos
RPM packaging directly on your Jolla phone.
Root & User SSH access to Jolla via WinSCP.
Root and User SSH access to Jolla via Nautilus on Linux PC.
Last edited by Schturman; 2012-11-11 at 14:41.