0

I'm new to Linux.

Recently I bought a VPS to host a teamspeak server on. I am running Ubuntu 14.04. All is well but I need to run a script called ts3recover.sh:

#! /usr/bin/env bash
# init
function pause(){
   read -p "$*"
}
/usr/bin/clear
echo "This script replaces the serveradmin password to reenable access
to your server. Use this script at your own risk.

Feel free to improve or extend this script. Share your modifications
on teamspeak forums (http://forum.teamspeak.com). Thank you.

Press any key to continue or ctrl+c to cancel..."
pause

echo "Current serveradmin and crypted password:"

sqlite3 ts3server.sqlitedb <<SQL_1
.header ON
SELECT client_login_name, client_login_password 
  FROM clients 
  WHERE client_id='1';
SQL_1

sqlite3 ts3server.sqlitedb <<SQL_2
UPDATE clients
  SET client_login_password = "r5oBZ3Z8s8IqjiEJ/k3o9dkSUgU=" 
  WHERE client_id = "1";
SQL_2

echo "updated entry:"

sqlite3 ts3server.sqlitedb <<SQL_3
SELECT client_login_name, client_login_password
  FROM clients
  WHERE client_id='1';
SQL_3

echo "
Server Query Admin Acccount replaced

 Password: ykN+zfqD

 NOTE:  This password has been copied from another database and is
        not safe. Update it directly after logging into your query
        console. Use the clientsetserverquerylogin command.
        You can enter help clientsetserverquerylogin for details.

"

Unfortunately, when I try to execute it, I have this returned.

---@-----:/usr/local/teamspeak# ./ts3recover.sh
: No such file or directory

But

---@-----:/usr/local/teamspeak# file ts3recover.sh
ts3recover.sh: a /usr/bin/env bash\015 script, ASCII text executable, with CRLF line terminators

I have searched in regards to this problem and installed many 32-bit libraries (I think that's what they are called) but to no avail! It will not run!

Any help will be appreciated. :)

2

Your shell script uses Windows line endings(CR+LF). You need to convert it to Unix line endings (LF), for example using dos2unix.

  • @Kuhuqo If it worked, please click the checkmark by this answer. It will flag the answer as working and make it easier for others with the same problem to get a solution. – Kaz Wolfe Jul 18 '15 at 19:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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