1

So I made a bash script to automatically get ts3 installed and running on my vps, but for some reason it doesn't work.

The error I get is:

> /root/install/ts3install.sh: 4: cd: can't cd to /root/teamspeak3-server_linux-x86/

> /root/install/ts3install.sh: 6: /root/install/ts3install.sh:
> ./ts3server_startscript.sh: not found

This is my script:

 #!/bin/sh
wget http://dl.4players.de/ts/releases/3.0.11.3/teamspeak3-server_linux-x86-3.0.11.3.tar.gz
tar -xzvf teamspeak3-server_linux-x86-3.0.11.3.tar.gz
cd /root/teamspeak3-server_linux-x86/
cd `pwd`
./ts3server_startscript.sh start

Can anybody help?

4
  • Are you supposed to execute the installer from /? Do the contents of the tar file have a hardcoded full path? Commented Jun 5, 2015 at 20:43
  • Uhm I am not familar with linux really I just thaught myself a bit by reading tutorials etc. But when I execute the commands in my bash in Putty everything works fine. Just the bash does not work for some reason :/ Can you maybe tell me in "amateur language" what you were exactly referring to? :P
    – Ympker
    Commented Jun 5, 2015 at 20:47
  • type this: tar -tzvf teamspeak3-server_linux-x86-3.0.11.3.tar.gz (using t to "type" or list the contentx, not x to extract) -- what do you see? Commented Jun 5, 2015 at 21:01
  • Why the cd `pwd` ? Commented Jun 5, 2015 at 21:23

1 Answer 1

3

You should not cd into /root/teamspeak3-server_linux-x86. This is not where the file would have got extracted. It would have been extracted in your current location.

So, the correct script would be:

 #!/bin/sh
wget http://dl.4players.de/ts/releases/3.0.11.3/teamspeak3-server_linux-x86-3.0.11.3.tar.gz
tar -xzvf teamspeak3-server_linux-x86-3.0.11.3.tar.gz
cd teamspeak3-server_linux-x86/
./ts3server_startscript.sh start
4
  • That script doesnt work for me unfortunately :( And the wget is always downloaded to "/" and not "/root/install" where i want it to be downloaded
    – Ympker
    Commented Jun 5, 2015 at 20:51
  • Well the script works now if I exec it from WinSCP via SFTP however when I exec it through my control panel (web) it doesn't work :/
    – Ympker
    Commented Jun 5, 2015 at 20:55
  • Can I somehow download the "wget" directly to /root/install ?
    – Ympker
    Commented Jun 5, 2015 at 20:55
  • First of all, you are not downloading "wget". You are downloading a "file" using wget. And, yes, you can download it to /root/install. Just use the -P option: wget -P /root/install http://file-link.tar.gz
    – shivams
    Commented Jun 5, 2015 at 21:00

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.