Reply
Thread Tools
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#51
 
moudy91's Avatar
Posts: 165 | Thanked: 18 times | Joined on Jun 2010
#52
Originally Posted by nicolai View Post
How did you create the file (what operating system, windows or linux?)

http://en.wikipedia.org/wiki/Newline#Common_problems
Widows .
Can you please upload the sh file and I will download it to my phone please
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#53
I can not upload simple shell scripts.
I had to compress it with gz.
Upload the file to your device and in
xterm enter
gzip -d change_brightness.sh.gz
Attached Files
File Type: gz change_brightness.sh.gz (156 Bytes, 74 views)
 

The Following User Says Thank You to nicolai For This Useful Post:
moudy91's Avatar
Posts: 165 | Thanked: 18 times | Joined on Jun 2010
#54
Originally Posted by nicolai View Post
I can not upload simple shell scripts.
I had to compress it with gz.
Upload the file to your device and in
xterm enter
gzip -d change_brightness.sh.gz
i did what just you told me and nothing happen just i click it and nothing changed, please do you have another way ?
 
moudy91's Avatar
Posts: 165 | Thanked: 18 times | Joined on Jun 2010
#55
Originally Posted by nicolai View Post
I can not upload simple shell scripts.
I had to compress it with gz.
Upload the file to your device and in
xterm enter
gzip -d change_brightness.sh.gz
it worked, thanks man
your my saver
 

The Following User Says Thank You to moudy91 For This Useful Post:
moudy91's Avatar
Posts: 165 | Thanked: 18 times | Joined on Jun 2010
#56
Originally Posted by nicolai View Post
I can not upload simple shell scripts.
I had to compress it with gz.
Upload the file to your device and in
xterm enter
gzip -d change_brightness.sh.gz
dear nicolai first i want to thank you for your help.
i want the same script .sh but with bluetooth, i did create this command but when i press it the bluetooth turn on, but when i press it again it dont turn off.

Code:
#!/bin/sh
if [ dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.manager.ListAdapter |  awk -F "\"" "'/at/ {print $}') org.bluez.Adapter.SetProperty String: Powerd variant:boolean:true | echo "" ]; then
if [ dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.manager.ListAdapter |  awk -F "\"" "'/at/ {print $}') org.bluez.Adapter.SetProperty String: Powerd variant:boolean:false | echo ""
else
if [ dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.manager.ListAdapter |  awk -F "\"" "'/at/ {print $}') org.bluez.Adapter.SetProperty String: Powerd variant:boolean:true | echo ""
fi

Last edited by moudy91; 2012-02-07 at 07:33.
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#57
To much quotes (")
awk -F "\"" '/at/ {print $}'
instead of
awk -F "\"" "'/at/ {print $}'
Code:
#!/bin/sh
if [ dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.manager.ListAdapter |  awk -F "\"" '/at/ {print $}') org.bluez.Adapter.SetProperty String: Powerd variant:boolean:true | echo "" ]; then
if [ dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.manager.ListAdapter |  awk -F "\"" '/at/ {print $}') org.bluez.Adapter.SetProperty String: Powerd variant:boolean:false | echo ""
else
if [ dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.manager.ListAdapter |  awk -F "\"" '/at/ {print $}') org.bluez.Adapter.SetProperty String: Powerd variant:boolean:true | echo ""
fi
 
moudy91's Avatar
Posts: 165 | Thanked: 18 times | Joined on Jun 2010
#58
Originally Posted by nicolai View Post
To much quotes (")
awk -F "\"" '/at/ {print $}'
instead of
awk -F "\"" "'/at/ {print $}'
Code:
#!/bin/sh
if [ dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.manager.ListAdapter |  awk -F "\"" '/at/ {print $}') org.bluez.Adapter.SetProperty String: Powerd variant:boolean:true | echo "" ]; then
if [ dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.manager.ListAdapter |  awk -F "\"" '/at/ {print $}') org.bluez.Adapter.SetProperty String: Powerd variant:boolean:false | echo ""
else
if [ dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.manager.ListAdapter |  awk -F "\"" '/at/ {print $}') org.bluez.Adapter.SetProperty String: Powerd variant:boolean:true | echo ""
fi
hi.
i did copy your code and then paste it into my sh and nothing happens, please can you correct the code, because my code usual open the bluetooth but never power off if i will press it again
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 09:43.