[Need help on shell script]

ImbaWind

Senior Member
Jul 12, 2011
1,774
3,895
143
?
Can anyone tell me how to add lines in one file by another bash file?

I make a script to change governors and frequency but I need to make the setting set on boot (But I dun want use 3rd party app like SetCPU).

So I need to add these lines to init.d folder's file :
Code:
#!/system/bin/bash (and i add line but this is by default?)
echo "interactiveX" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor (if the next time i chg setting , will this line be deleted or there will be another line with new setting?)
echo "800000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo "245670" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
so what command should i use to add these line ?
 

ImbaWind

Senior Member
Jul 12, 2011
1,774
3,895
143
?
Code:
#!/system/bin/sh
thanks for your reply but i dont really understand...:(
those '800000' , '245670' and 'interactiveX' are just some example

i mean i want to write this:
echo "800000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

in init.d folder's file by other file
 

ImbaWind

Senior Member
Jul 12, 2011
1,774
3,895
143
?
this file is in /system/bin
so i can access and chg my cpu setting by typing 'cpuclock'
there for i need a command to add line to init.d in order to set on boot

Code:
echo " Change CPU Governor Profile "
		echo ""
		echo ""
		echo " Current Governor: "
		echo "$CUR_GOV"
		echo ""
		$sleep
		echo " Available Governors: "
		echo "$AVAIL_GOV"
		echo ""
		$sleep
		echo " Insert your desired governor: "
		echo -n " Your Governor: ";read GOV
		echo $GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
[COLOR="Red"][so now i change my current governor,but the governor will be reset to default(ondemand) after next reboot]
[all i want is , while echoing current governor , i need to add one line to init.d there too , but i don know how :(][/COLOR]
		echo " Complete "
		echo ""
		$sleep
		echo -e " Current Governor: "
		echo ""
		echo ""
		$sleep
		echo -n " Press Enter Key To Continue... ";
		read enterKey
		opt=0;;
 
Last edited: