free

News

collapse

User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Who's Online

  • Dot Guests: 202
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Birthday Calender

December 2025
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 [30] 31

[Bash] Halp with script

Teddy · 1287

0 Members and 1 Guest are viewing this topic.

Offline TeddyTopic starter

  • Orc
  • *****
    • Posts: 9161
  • "I'm on top of the world because of you."
  • With us since: 05/02/2011
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
on: August 11, 2014, 07:31:42 am
Hi,

Over in TeamSpeak we have a problem during the daily restart that appears to crash the TS3 bot clients. Since they're running on Linux an easy solution to reconnected is a bit of a challenge. So I want to have a cron run every 5 minutes to kick the bot back up. It runs on a screen called "music", here is the current script:

Code: [Select]
#!/bin/bash
if ps aux | grep "[.]/ts3client_linux_amd64" > /dev/null
then
    echo "AYEOK"
else
    screen -X -S music quit
    screen -S music -d -m
    screen -r music -p 0 -X stuff "sh /root/MusicBot/boot.sh `echo -ne '\015'`"
fi

The idea is to kill the existing music screen, then recreate it and throw a command at it. The problem is the command only sits in the screen terminal and doesn't enter. the `echo -ne '\015'` should in enter the command.. in theory.

The detection works fine.

Any ideas?



Offline SugarD

  • Hero
  • ****
    • Posts: 11515
    With us since: 21/03/2008
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Reply #1 on: October 23, 2014, 11:30:04 am
Did you ever get this issue resolved?



Offline TeddyTopic starter

  • Orc
  • *****
    • Posts: 9161
  • "I'm on top of the world because of you."
  • With us since: 05/02/2011
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Reply #2 on: October 23, 2014, 08:48:48 pm
YES DADDY



Offline Archie

  • Veteran
  • ***
    • Posts: 974
  • Sven_Clark
  • With us since: 12/10/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
  • SA:MP: Archie
Reply #3 on: October 23, 2014, 09:44:24 pm
It's locked.

back again!


 


SimplePortal 2.3.7 © 2008-2025, SimplePortal