I ran your 1st script btc_uzr got this
sh cgrestart.sh
cgrestart.sh: line 9: syntax error: unexpected "done" (expecting "then")
[1]+ Done(127) bash cgrestart.sh
I assume you ran it on your desktop pc or similar, since the script executes fine on my KnCMiner; tested a min ago
On KnC devices there's no bash but sh.
/bin/sh -> /bin/busybox
and for example Ubuntu links it to dash
/bin/sh -> dash