![]() |
Help - Bash script - SOLVED you can close this thread ;) a new package is coming for us
hi guys, i'm working with bash, i'm creating a script that check the battery status and the wall carger status to do some things like keep battery life disabling some features (wifi, 3g mode, ringtone, vibration, bluetooth, fmradio, etc)
can somone help me? the script has to save the current profile if different from silent, i made some mistakes and i'm a little bit confused with it becouse it doesnt save the right used profile. this is the code i made **** the code is in test for that i left "battery.charge_level.percentage = " empty to test it better |
Re: Help - Bash script
|
Re: Help - Bash script
Quote:
|
Re: Help - Bash script
You could try "cp /home/user/.profiled/current /home/user/profilo.txt"
|
Re: Help - Bash script
Quote:
Code:
run-standalone.sh dbus-send --type=method_call --print-reply --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.get_profile | grep "string" | sed s/' string '/''/g > /home/user/profilo.txt && sleep 2 |
Re: Help - Bash script
Quote:
i was doing a stupid work :D it was not needed |
Re: Help - Bash script
For God's sake please use functions () { }; in your script
And attach scripts here to tmo as attachment, rather than using pastebin which will vanisch in a week, or month, or year the latest BTW if you definitely need bash then you should use #!/bin/bash Your shebang is calling ash aka messybox on a standard maemo system /j |
Re: Help - Bash script
Quote:
|
Re: Help - Bash script
Quote:
If you got 2 or more locations that look like Code:
... Code:
myABCDfunction() Code:
... If you got Code:
B 1 Code:
B 2 Code:
myABCDfunction() Code:
... [edit] another comment: when you need to use sudo then you obviously don't run the script under root, so you don't need to use run-standalone (though it doesn't hurt). To do arbitrary commands via sudo you probably need to tweak sudoers config in /etc/sudores.d/yourfile a bit. [/edit] |
Re: Help - Bash script
Quote:
|
All times are GMT. The time now is 04:53. |
vBulletin® Version 3.8.8