ianharrier / synology-scripts

Scripts for Synology DSM
MIT License
110 stars 33 forks source link

Error on execution #11

Closed C0rwen closed 3 years ago

C0rwen commented 3 years ago

Hello.

I try to execute this script on my Synology NAS DS920+. My version of DSM is DSM 6.2.4-25556

I have this error on the execution

reconnect-vpn.sh: line 13: $'\r': command not found reconnect-vpn.sh: line 17: $'\r': command not found reconnect-vpn.sh: line 23: $'\r': command not found reconnect-vpn.sh: line 27: $'\r': command not found reconnect-vpn.sh: line 30: $'\r': command not found reconnect-vpn.sh: line 33: $'\r': command not found reconnect-vpn.sh: line 37: syntax error near unexpected token `elif'

'econnect-vpn.sh: line 37: `elif [[ $CONFIGS_QTY -gt 1 ]]; then

Someone can help me ?

Have a nice day

C0rwen commented 3 years ago

Any ideas ?

DummerJunge commented 3 years ago

Windows style newline characters? Save with correct end of line encoding, see https://unix.stackexchange.com/questions/391223/why-am-i-getting-line-1-r-command-not-found

ianharrier commented 3 years ago

@C0rwen, I agree with @DummerJunge: this looks like an issue with line endings. How did you configure the script to run?

GamerGun commented 3 years ago

dos2unix

https://www.rdocumentation.org/packages/icesTAF/versions/3.6.0/topics/dos2unix

DummerJunge commented 3 years ago

dos2unix

https://www.rdocumentation.org/packages/icesTAF/versions/3.6.0/topics/dos2unix

AFAIK not OOB on a Syno NAS

GamerGun commented 3 years ago

Yeah true, better to make sure that you use scp or in case of (s)ftp do a binary copy

DummerJunge commented 3 years ago

Yeah true, better to make sure that you use scp or in case of (s)ftp do a binary copy

Or ssh, change dir and wget https://raw.githubusercontent.com/ianharrier/synology-scripts/master/reconnect-vpn.sh

May use Download Station ...

ianharrier commented 3 years ago

I'm going to close this, as it doesn't appear to be an issue with the script itself.

C0rwen commented 3 years ago

Thank you for you help. It was a issue with end of line. With a wget it's better