Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Script Not Running

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
spen24423
Posts: 5
Joined: 2017-03-09 02:43

Script Not Running

#1 Post by spen24423 »

I am trying to run this script on Debian;

#!/bin/bash
#
# Debian
#

set -v

apt-get -y update

apt-get install -y ntpdate
apt-get install -y squid3 apache2-utils

cp /etc/squid3/squid.conf /etc/squid3/squid.conf.bak

cat << EOF > /etc/squid3/squid.conf
http_port 3128
http_access allow all
cache deny all
forwarded_for delete
request_header_access Via deny all
EOF

/etc/init.d/squid3 restart

echo "IP ADDRESS"

curl ifconfig.co

#Be sure to shutdown/terminate your VM after you are done!

When I upload it and run the script using;
chmod +x proxy-debian-linux_.sh
sudo ./proxy-debian-linux_.sh

I get the error; cannot access:"Proxy-Debian-Linux" no such file or directory. How is this? Why is this? Thank you so much for you help.

User avatar
nova_nul
Posts: 5
Joined: 2016-12-21 05:04

Re: Script Not Running

#2 Post by nova_nul »

Hi.
It happened to me before.
Then I found that my script was edited in windows so that it was "dos" fileformat, which cause bash can not interpret the script and reply "no such file or directory".
Try to edit the script at vim.
Then

Code: Select all

:set ff
If you got "ff=dos",then

Code: Select all

:set ff=unix
Last edited by nova_nul on 2017-03-10 09:37, edited 1 time in total.
Nice to meet you , too.

spen24423
Posts: 5
Joined: 2017-03-09 02:43

Re: Script Not Running

#3 Post by spen24423 »

Thank you!

So do I enter that in the terminal?

spen24423
Posts: 5
Joined: 2017-03-09 02:43

Re: Script Not Running

#4 Post by spen24423 »

I figured out how to do it but I got:

ff=unix

Since that is the case why is it not working?

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Script Not Running

#5 Post by dasein »

spen24423 wrote:chmod +x proxy-debian-linux_.sh
sudo ./proxy-debian-linux_.sh

I get the error; cannot access:"Proxy-Debian-Linux" no such file or directory. How is this? Why is this? Thank you so much for you help.
This may or may not be your problem, but either you're mistyping the name of the script when you run it, or you mistyped it in your description of your problem. (*nix filenames are case-sensitive.)

What's the ouput of

Code: Select all

ls -l
in the directory where the script lives?

pendrachken
Posts: 1394
Joined: 2007-03-04 21:10
Location: U.S.A. - WI.

Re: Script Not Running

#6 Post by pendrachken »

Make sure the filesystem / area you have uploaded the script to is not mounted noexec ( for security purposes ). This is often done for public / semi public FTP upload dirs as an additional level of security.

That and as dasein said: unix / linux is generally CaSe SenSiTive.
fortune -o
Your love life will be... interesting.
:twisted: How did it know?

The U.S. uses the metric system too, we have tenths, hundredths and thousandths of inches :-P

spen24423
Posts: 5
Joined: 2017-03-09 02:43

Re: Script Not Running

#7 Post by spen24423 »

Thank you to all of you for the help!

This time when I uploaded the file and ran the script I still got the error, but when I ran ls -l the script name popped up in green.

User avatar
nova_nul
Posts: 5
Joined: 2016-12-21 05:04

Re: Script Not Running

#8 Post by nova_nul »

Hi.
The name of script is green because the executable file is grenn by default.
Maybe you should post what was popped up(all output of 'ls -l').
Nice to meet you , too.

spen24423
Posts: 5
Joined: 2017-03-09 02:43

Re: Script Not Running

#9 Post by spen24423 »

Ouput of "ls -l":

spencerbolling@instance-1:~$ ls -l
total 4
-rwxr-xr-x 1 spencerbolling spencerbolling 475 Mar 11 04:51 Proxy-Debian-Linux.sh

How do I check and change the mounted noexec?

Dai_trying
Posts: 1100
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: Script Not Running

#10 Post by Dai_trying »

looks like a typo in your command, you will need to type the filename correctly for it to be found including underscores (or without depending which post is correct)

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Script Not Running

#11 Post by debiman »

what's the output of

Code: Select all

sudo ./Proxy-Debian-Linux.sh
???

Post Reply