Downloaded script will not work

General support questions
Post Reply
infiniteoddity
Posts: 2
Joined: 2017/10/20 14:29:56

Downloaded script will not work

Post by infiniteoddity » 2017/10/20 14:59:06

I have a somewhat strange issue. I have a bash script to do an application install. If I download it from an ftp it simply doesn't work. All commands fail. However if I create the script on my server and put in the exact same commands it runs without an issue.

I thought at first it was permissions related so I tried taking ownership, changing permissions but it still does not run.

To test I then created a simple script to add some firewall rules and it does exactly the same thing. It can not find the firewall service and complains about illegal commands and yet if I create then run the script in the same folder manually it works with no issue.

Has anyone seen this before?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Downloaded script will not work

Post by TrevorH » 2017/10/20 16:03:59

Does it work if you run dos2unix against the downloaded file?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

infiniteoddity
Posts: 2
Joined: 2017/10/20 14:29:56

Re: Downloaded script will not work

Post by infiniteoddity » 2017/10/23 09:05:59

Awesome! The encoding change to unix did the trick. Thanks for the help!

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Downloaded script will not work

Post by TrevorH » 2017/10/23 09:50:43

There's an ftp option to do that automatically.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply