|
2012-11-08
, 22:48
|
Posts: 299 |
Thanked: 557 times |
Joined on Aug 2012
|
#4562
|
Tested right now, work perfectly ! Thank you !
Tell me something.. We can not shorten the progress bar in CURL and what with WGET ?
Can we add short (for portrait mode) progress bar to wget command, not only percentage?
Something like:
orCode:Downloading status: [=====> ] 59%
or something else ?Code:Downloading status: [####### ] 59%
The Following User Says Thank You to brkn For This Useful Post: | ||
|
2012-11-09
, 00:57
|
Posts: 299 |
Thanked: 557 times |
Joined on Aug 2012
|
#4563
|
devel-su cd /home/user/MyDocs/Downloads/ wget https://www.dropbox.com/s/a7qncxnt4hs4e7w/dialog_1.0-20060221-3_armel.deb?dl=1 dpkg -x dialog_1.0-20060221-3_armel.deb /opt/extrautils
#!/bin/sh # downloader for schturman's n9qtweak # author: brkn # date: 2012-11-09 # v0.1.0 trap 'rm -r wget-log tmp.log && killall wget; exit 0' 2 15 URL="http://dl.dropbox.com/u/17706605/n9-qtweakall_9.4_armel.deb" gui_wget() { rm wget-log* tmp.log &> /dev/null wget -b $1 &> /dev/null cp wget-log tmp.log PERCENT="0" { while [ "${PERCENT}" != "100" ] ; do PERCENT=`awk -F: '$1 ~ /KB/ { print }' tmp.log | tail -n1 | cut -b 62-64` echo $PERCENT cp wget-log tmp.log done } | /opt/extrautils/usr/bin/dialog --title "Downloading ..." --gauge "$1" 8 40 0 rm wget-log tmp.log } gui_wget ${URL} /opt/extrautils/usr/bin/dialog --title "Download finished!" --infobox "oh boy, can't wait to see the update!" 4 40 exit 0
The Following 2 Users Say Thank You to brkn For This Useful Post: | ||
|
2012-11-09
, 01:23
|
|
Posts: 5,339 |
Thanked: 4,133 times |
Joined on Jan 2010
@ Israel
|
#4564
|
|
2012-11-09
, 02:19
|
|
Posts: 5,339 |
Thanked: 4,133 times |
Joined on Jan 2010
@ Israel
|
#4565
|
The Following User Says Thank You to Schturman For This Useful Post: | ||
|
2012-11-09
, 09:29
|
Posts: 299 |
Thanked: 557 times |
Joined on Aug 2012
|
#4566
|
Ok, I tested it...
It Cool, but work not so good.. Too much times this progress bar got stuck on some percentage and this dialog window can't close itself, but file already downloaded.. For close it I need to press "Ctrl+C"
Also, can you remove this blue background, that user can see the background of N9QT ?
Another question.. .Why it have so big space between the last words in N9QT until the blue background ?
And with this dialog we not need grep and sed anymore ?
Thanks
|
2012-11-09
, 09:48
|
|
Posts: 5,339 |
Thanked: 4,133 times |
Joined on Jan 2010
@ Israel
|
#4567
|
Please attach the modified UPDATER script. No need for sed and grep anymore.
#!/bin/sh RED='\033[1;31m' CYAN='\033[1;36m' NORMAL='\033[0m' YELLOW='\033[1;33m' BLINK='\033[5m' if [ ! -f /etc/apt/sources.list.d/sdk.list ] then echo 'deb http://harmattan-dev.nokia.com/ harmattan/sdk free non-free' > /etc/apt/sources.list.d/sdk.list apt-get update fi if [ ! -f /bin/bash ]; then echo "bash not installed, trying to install..." pkill pkgmgrd rm /var/lib/dpkg/lock echo "" | dpkg -i /opt/N9QTweak/SYS/bash* || echo "failed to install bash" fi if [ ! -f /home/user/MyDocs/Documents/N9_QuickTweak_*.pdf ] then echo "PDF instruction not here! Open PDF downloader.." echo "For Exit, just press Enter..." echo "" echo " ---------------------------------------------" echo -e "| ${CYAN}N9 QuickTweak PDF downloader${NORMAL} |" echo " ---------------------------------------------" echo -e "| ${YELLOW}A: English PDF instruction${NORMAL} |" echo -e "| ${YELLOW}B: Russian PDF instruction${NORMAL} |" echo -e "| ${YELLOW}C: Both PDF instructions${NORMAL} |" echo " ---------------------------------------------" echo -e "| ${YELLOW}D: PDF file with links ONLY !${NORMAL} |" echo " ---------------------------------------------" echo "After applying you will find PDF file in your:" echo -e "${CYAN}/home/user/MyDocs/Documents${NORMAL}" echo "" read -p "Choose a letter: " ANS case $ANS in a|A) if eval "ping -c 1 www.google.com" > /dev/null;then if [ ! -f /usr/bin/wget ]; then echo "wget not installed, trying to install..." pkill pkgmgrd rm /var/lib/dpkg/lock echo "" | dpkg -i /opt/N9QTweak/SYS/wget* || echo "failed to install wget" echo "" echo -e "${BLINK}${RED}WAIT!${NORMAL} ${YELLOW}Downloading PDF instruction...${NORMAL}" cd /home/user/MyDocs/Documents download() { local url=$1 echo -n " " wget --progress=dot $url 2>&1 | /opt/N9QTweak/SYS/bin/grep --line-buffered "%" | \ /opt/N9QTweak/SYS/bin/sed -u -e "s,\.,,g" | awk '{printf("\b\b\b\b%4s", $2)}' echo -ne "\b\b\b\b" echo " DONE" } file="http://dl.dropbox.com/u/17706605/N9_QuickTweak_en_v9.5.pdf" echo -n "Downloading status:" download "$file" echo "" echo -e "${YELLOW}PDF instruction downloaded successfully...${NORMAL}" else echo "" echo -e "${BLINK}${RED}WAIT!${NORMAL} ${YELLOW}Downloading PDF instruction...${NORMAL}" cd /home/user/MyDocs/Documents trap 'rm -r wget-log tmp.log && killall wget; exit 0' 2 15 URL="http://dl.dropbox.com/u/17706605/N9_QuickTweak_en_v9.4.pdf" URL2="http://dl.dropbox.com/u/17706605/N9_QuickTweak_ru_v9.4.pdf" gui_wget() { rm wget-log* tmp.log &> /dev/null wget -b $1 &> /dev/null cp wget-log tmp.log PERCENT="0" { while [ "${PERCENT}" != "100" ] ; do PERCENT=`awk -F: '$1 ~ /KB/ { print }' tmp.log | tail -n1 | cut -b 62-64` echo $PERCENT cp wget-log tmp.log done } | /opt/N9QTweak/SYS/bin/dialog --title "Downloading ..." --gauge "$1" 8 40 0 rm wget-log tmp.log } gui_wget ${URL} gui_wget ${URL2} echo "" echo -e "${YELLOW}PDF instruction downloaded successfully...${NORMAL}" fi else echo "" echo -e "${RED}You are ${BLINK}NOT${NORMAL} ${RED}connected, CAN'T download...${NORMAL}" echo "You got only PDF file with links!" cp -f /opt/N9QTweak/N9_QuickTweak_*.pdf /home/user/MyDocs/Documents echo "" echo "Open N9 QuickTweak menu..." fi ;; b|B) if eval "ping -c 1 www.google.com" > /dev/null;then if [ ! -f /usr/bin/wget ]; then echo "wget not installed, trying to install..." pkill pkgmgrd rm /var/lib/dpkg/lock echo "" | dpkg -i /opt/N9QTweak/SYS/wget* || echo "failed to install wget" echo "" echo -e "${BLINK}${RED}WAIT!${NORMAL} ${YELLOW}Downloading PDF instruction...${NORMAL}" cd /home/user/MyDocs/Documents download() { local url=$1 echo -n " " wget --progress=dot $url 2>&1 | /opt/N9QTweak/SYS/bin/grep --line-buffered "%" | \ /opt/N9QTweak/SYS/bin/sed -u -e "s,\.,,g" | awk '{printf("\b\b\b\b%4s", $2)}' echo -ne "\b\b\b\b" echo " DONE" } file="http://dl.dropbox.com/u/17706605/N9_QuickTweak_ru_v9.5.pdf" echo -n "Downloading status:" download "$file" echo "" echo -e "${YELLOW}PDF instruction downloaded successfully...${NORMAL}" else echo "" echo -e "${BLINK}${RED}WAIT!${NORMAL} ${YELLOW}Downloading PDF instruction...${NORMAL}" cd /home/user/MyDocs/Documents download() { local url=$1 echo -n " " wget --progress=dot $url 2>&1 | /opt/N9QTweak/SYS/bin/grep --line-buffered "%" | \ /opt/N9QTweak/SYS/bin/sed -u -e "s,\.,,g" | awk '{printf("\b\b\b\b%4s", $2)}' echo -ne "\b\b\b\b" echo " DONE" } file="http://dl.dropbox.com/u/17706605/N9_QuickTweak_ru_v9.5.pdf" echo -n "Downloading status:" download "$file" echo "" echo -e "${YELLOW}PDF instruction downloaded successfully...${NORMAL}" fi else echo "" echo -e "${RED}You are ${BLINK}NOT${NORMAL} ${RED}connected, CAN'T download...${NORMAL}" echo "You got only PDF file with links!" cp -f /opt/N9QTweak/N9_QuickTweak_*.pdf /home/user/MyDocs/Documents echo "" echo "Open N9 QuickTweak menu..." fi ;; c|C) if eval "ping -c 1 www.google.com" > /dev/null;then if [ ! -f /usr/bin/wget ]; then echo "wget not installed, trying to install..." pkill pkgmgrd rm /var/lib/dpkg/lock echo "" | dpkg -i /opt/N9QTweak/SYS/wget* || echo "failed to install wget" echo "" echo -e "${BLINK}${RED}WAIT!${NORMAL} ${YELLOW}Downloading PDF instruction...${NORMAL}" cd /home/user/MyDocs/Documents download() { local url=$1 echo -n " " wget --progress=dot $url 2>&1 | /opt/N9QTweak/SYS/bin/grep --line-buffered "%" | \ /opt/N9QTweak/SYS/bin/sed -u -e "s,\.,,g" | awk '{printf("\b\b\b\b%4s", $2)}' echo -ne "\b\b\b\b" echo " DONE" } file="http://dl.dropbox.com/u/17706605/N9_QuickTweak_en_v9.5.pdf http://dl.dropbox.com/u/17706605/N9_QuickTweak_ru_v9.5.pdf" echo -n "Downloading status:" download "$file" echo "" echo -e "${YELLOW}PDF instruction downloaded successfully...${NORMAL}" else echo "" echo -e "${BLINK}${RED}WAIT!${NORMAL} ${YELLOW}Downloading PDF instruction...${NORMAL}" cd /home/user/MyDocs/Documents download() { local url=$1 echo -n " " wget --progress=dot $url 2>&1 | /opt/N9QTweak/SYS/bin/grep --line-buffered "%" | \ /opt/N9QTweak/SYS/bin/sed -u -e "s,\.,,g" | awk '{printf("\b\b\b\b%4s", $2)}' echo -ne "\b\b\b\b" echo " DONE" } file="http://dl.dropbox.com/u/17706605/N9_QuickTweak_en_v9.5.pdf http://dl.dropbox.com/u/17706605/N9_QuickTweak_ru_v9.5.pdf" echo -n "Downloading status:" download "$file" echo "" echo -e "${YELLOW}PDF instruction downloaded successfully...${NORMAL}" fi else echo "" echo -e "${RED}You are ${BLINK}NOT${NORMAL} ${RED}connected, CAN'T download...${NORMAL}" echo "You got only PDF file with links!" cp -f /opt/N9QTweak/N9_QuickTweak_*.pdf /home/user/MyDocs/Documents echo "" echo "Open N9 QuickTweak menu..." fi ;; d|D) echo "You got PDF file with links. Continue to menu.." cp -f /opt/N9QTweak/N9_QuickTweak_*.pdf /home/user/MyDocs/Documents ;; * ) read -p "You chose to not download. Continue to menu..." end; continue ;; esac echo " " else echo "Open N9 QuickTweak menu..." fi if [ -f /bin/bash ] then bash /opt/N9QTweak/N9QT else echo "bash not installed. exiting..." sleep 2 exit 0 fi
|
2012-11-09
, 11:13
|
Posts: 299 |
Thanked: 557 times |
Joined on Aug 2012
|
#4568
|
devel-su cd /home/user/MyDocs/Downloads/ wget https://www.dropbox.com/s/a7qncxnt4hs4e7w/dialog_1.0-20060221-3_armel.deb?dl=1 dpkg -x dialog_1.0-20060221-3_armel.deb /opt/extrautils wget https://www.dropbox.com/s/y1jnb91cpxqgsx6/bc_1.06.95-2%2Bmaemo9%2B0m6_armel.deb? dl=1 dpkg -x bc_1.06.95-2+maemo9+0m6_armel.deb /opt/extrautils
#!/bin/sh URL="http://dl.dropbox.com/u/17706605/N9_QuickTweak_en_v9.4.pdf" FILE=$(basename $URL) rm -f $FILE length=$(curl --head $URL 2>&1 | grep Content-Length | awk '{print $2}') length_kb=$(($length >> 10)) scale=$(echo "scale=6; 100/$length" | /opt/extrautils/usr/bin/bc) wget $URL 2>/dev/null & ( while ( true ) do proc=$(ps aux | grep -v grep | grep wget | grep $FILE ) if [[ "$proc" == "" ]]; then break; fi size=$(ls -l $FILE 2>/dev/null | awk '{print $5}' 2>/dev/null) if [ "$size" != "" ]; then { metre=$(printf %.0f $(echo "$size*$scale" | /opt/extrautils/usr/bin/bc)) } fi echo "XXX" echo "file: $FILE" echo "size: $length_kb kb" echo "Please standby ..." echo "XXX" echo $metre done ) | /opt/extrautils/usr/bin/dialog --title " N9 QuickTweak Updater " --no-collapse --gauge "Download Test" 8 40 /opt/extrautils/usr/bin/dialog --title " N9 QuickTweak Updater " --infobox "$FILE successfully downloaded" 4 40 exit 0
The Following User Says Thank You to brkn For This Useful Post: | ||
|
2012-11-09
, 11:19
|
|
Posts: 5,339 |
Thanked: 4,133 times |
Joined on Jan 2010
@ Israel
|
#4569
|
|
2012-11-09
, 13:36
|
Posts: 299 |
Thanked: 557 times |
Joined on Aug 2012
|
#4570
|
#!/bin/sh /opt/extrautils/usr/bin/dialog --menu "N9 QuickTweak PDF downloader" 15 40 5\ A "English PDF instruction"\ B "Russian PDF instruction" 2>dialog.tmp ANS=`cat dialog.tmp` dl() { URL=$1 FILE=$(basename $URL) rm -f $FILE LENGTH=$(curl --head $URL 2>&1 | grep Content-Length | awk '{print $2}') scale=$(echo "scale=6; 100/$LENGTH" | /opt/extrautils/usr/bin/bc) wget $URL 2>/dev/null & while ( true ) do proc=$(ps aux | grep -v grep | grep wget | grep $FILE ) if [[ "$proc" == "" ]]; then break; fi size=$(ls -l $FILE 2>/dev/null | awk '{print $5}' 2>/dev/null) if [ "$size" != "" ]; then { metre=$(printf %.0f $(echo "$size*$scale" | /opt/extrautils/usr/bin/bc)) } fi echo "XXX" echo "file: $FILE" echo "size: $LENGTH bytes" echo "Please standby ..." echo "XXX" echo $metre done | /opt/extrautils/usr/bin/dialog --clear --title " N9 QuickTweak Updater " --no-collapse --gauge "Download Test" 8 40 /opt/extrautils/usr/bin/dialog --clear --title " N9 QuickTweak Updater " --infobox "$FILE successfully downloaded" 4 40 } case $ANS in A) dl "http://dl.dropbox.com/u/17706605/N9_QuickTweak_en_v9.4.pdf";; B) dl "http://dl.dropbox.com/u/17706605/N9_QuickTweak_ru_v9.4.pdf";; esac rm -f dialog.tmp exit 0
The Following User Says Thank You to brkn For This Useful Post: | ||
Tags |
hebrew vkb, n9 qtweak, n9 quick tweak, n9 quicktweak, root-ssh |
|
Tell me something.. We can not shorten the progress bar in CURL and what with WGET ? Can we add short (for portrait mode) progress bar to wget command, not only percentage?
Something like:
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-08 at 22:41.