Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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?

share|improve this question
    
Are you supposed to execute the installer from /? Do the contents of the tar file have a hardcoded full path? –  glenn jackman Jun 5 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 Jun 5 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? –  glenn jackman Jun 5 at 21:01
    
Why the cd `pwd` ? –  roaima Jun 5 at 21:23

1 Answer 1

up vote 3 down vote accepted

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
share|improve this answer
    
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 Jun 5 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 Jun 5 at 20:55
    
Can I somehow download the "wget" directly to /root/install ? –  Ympker Jun 5 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 Jun 5 at 21:00
    
Awesome! Thanks mate :) –  Ympker Jun 5 at 21:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.