0

Sorry for my english in forum i found fix how to disable owerclocking in orange pi pc

 #!/bin/bash 

export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 

if [ "$(id -u)" != «0» ]; then 
echo «This script must be executed as root. Exiting» >&2 
exit 1 
fi 

Fex2Bin="$(which fex2bin)" 
if [ «X${Fex2Bin}» = «X» ]; then 
apt-get -f -q -y install sunxi-tools 
fi 

Path2ScriptBin="$(df | awk -F" " '/^\/dev\/mmcblk0p1/ {print $6}')" 
if [ ! -f "${Path2ScriptBin}/script.bin" ]; then 
echo «Can not find script.bin. Ensure boot partition is mounted» >&2 
exit 1 
fi 

MyTmpFile="$(mktemp /tmp/${0##*/}.XXXXXX)"
trap «rm \»${MyTmpFile}\"; exit 0" 0 1 2 3 15 

bin2fex <"${Path2ScriptBin}/script.bin" | grep -v "^LV" | grep -v "^max_freq" | grep -v "^min_freq" | grep -v "^extremity_freq" >"${MyTmpFile}" 
if [ $? -ne 0 ]; then 
echo «Could not convert script.bin to fex. Exiting» >&2 
exit 1 
fi 
cp -p "${Path2ScriptBin}/script.bin" "${Path2ScriptBin}/script.bin.bak" 

sed -i '/\[dvfs_table\]/a \ 
extremity_freq = 1296000000\ 
max_freq = 1200000000\ 
min_freq = 480000000\ 
LV_count = 7\ 
LV1_freq = 1296000000\ 
LV1_volt = 1320\ 
LV2_freq = 1200000000\ 
LV2_volt = 1240\ 
LV3_freq = 1104000000\
LV3_volt = 1180\ 
LV4_freq = 1008000000\ 
LV4_volt = 1140\ 
LV5_freq = 960000000\ 
LV5_volt = 1080\ 
LV6_freq = 816000000\ 
LV6_volt = 1020\ 
LV7_freq = 480000000\ 
LV7_volt = 980' "${MyTmpFile}" 

fex2bin "${MyTmpFile}" "${Path2ScriptBin}/script.bin" >/dev/null 
if [ $? -ne 0 ]; then 
mv "${Path2ScriptBin}/script.bin.bak" "${Path2ScriptBin}/script.bin" 
echo «Writing script.bin went wrong. Nothing changed» >&2 
exit 1 
fi 

echo «Successfully repaired broken overvolting/overclocking settings. Reboot necessary for changes to take effect»

and I have this errors

./fix.sh: line 53: unexpected EOF while looking for matching `"'
./fix.sh: line 59: syntax error: unexpected end of file

Can you help me how to solve it? Its not my script

  • might be having dos-style ending... convert the file to Unix-style using dos2unix fix.sh – Siva Apr 22 at 5:41
  • its doesnt fix problem( – iPavel_89 Apr 22 at 5:50
0

Welcome to Unix & Linux StackExchange!

./fix.sh: line 53: unexpected EOF while looking for matching `"'

This error message can be tricky, as it indicates line 53 of the script, which is where the shell noticed that something is going wrong with double quotes. Usually the actual error is a missing double quote somewhere before that.

The code formatting in your post is already trying to help you. Note that in the code you posted, at first only things within double quotes (") are displayed in red. But after this line, everything else turns red and things within double quotes are black or blue:

trap «rm \»${MyTmpFile}\"; exit 0" 0 1 2 3 15

The change of color scheme means this line has an unpaired double quote (that is not escaped with a backslash). It looks like an incomplete conversion from «...»-style quotes to standard double quotes.

This line should probably be:

trap "rm \"${MyTmpFile}\"; exit 0" 0 1 2 3 15

All the «...»-style quote in the script should probably also be converted to regular double quotes.

When writing scripts, you should never use an editor that replaces regular single or double quotes with "smart quotes" of any kind. Such a replacement will often break the script. If your editor does that, find out how to turn the "smart quotes" feature off.


./fix.sh: line 59: syntax error: unexpected end of file

This message tells you about a problem on line 59, but the script has only 58 lines. So the problem is at the very end of the script. The last line of the script has an unpaired quote that should be fixed.

| improve this answer | |
  • thank you i found error in line) but now have another error but not in syntax of script fexc-bin: Malformed data: version 174617441.1886938378. Could not convert script.bin to fex. Exiting – iPavel_89 Apr 22 at 6:08
  • The first part of that message seems to come from the bin2fex tool. It looks like your script.bin may have more severe problems than just broken overclocking settings. Sorry, I have no experience with OrangePi hardware configuration. – telcoM Apr 22 at 6:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.