View Single Post
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