Need help with scripting.

ThatGuyLurkin

Well-known member
Jun 4, 2012
2,155
665
0
How can I make a script that can be ran in the Terminal Emulator. I want to make 2 scripts. One to disable USB fast charge, and one to enable USB fast charge. I had attempted to make one and failed. I get a " USBon not found " from the terminal.


Anyone have any experience or ideas? Please, and thank you. :)
 
I think it's for jaws101 kernel for gb, ffc works pretty well, but I never did make a working script for it. Darn short term memory loss... I guess I could flash it again and make a toggle script. Android uses a form of bash, but some of the bash commands are not in the rom's bin folder.
 
What exactly needs to be there.


Only thing i THINK i know is that the script goes in Xbin. Is that right?


I tried looking up some threads but didnt find a thing.

Sent from my LG-VM670 using Tapatalk 2
 
It goes in bin, but the shebang needs to be #!/system/xbin/bash. I'm having a problem:
if [ content=$(</sys/kernel/fast_charge/force_fast_charge) == 0 ]
then
echo 1 > /sys/kernel/fast_charge/force_fast_charge
echo Turning force fast chage on.
else
echo 0 > /sys/kernel/fast_charge/force_fast_charge
echo Turning force fast chage off.
fi
ran it and it returns:
fast-charge.sh: 8: Syntax error: end of file unexpected (expecting "then")
 
It goes in bin, but the shebang needs to be #!/system/xbin/bash. I'm having a problem:
if [ content=$(</sys/kernel/fast_charge/force_fast_charge) == 0 ]
then
echo 1 > /sys/kernel/fast_charge/force_fast_charge
echo Turning force fast chage on.
else
echo 0 > /sys/kernel/fast_charge/force_fast_charge
echo Turning force fast chage off.
fi
ran it and it returns:
fast-charge.sh: 8: Syntax error: end of file unexpected (expecting "then")

Try this
if [ content=$(</sys/kernel/fast_charge/force_fast_charge) == 0 ]; <----This need to be at the end of the if statement.

The only problem is it well only run the "else" argument.
 
Last edited:

Trending Posts

Members online

Forum statistics

Threads
956,589
Messages
6,968,982
Members
3,163,580
Latest member
Adamsapple