1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Bash script to open all my servers in a screen ?

Discussion in 'Off-Topic' started by Miste, Jun 25, 2017.

  1. Miste

    Miste Baby Zombie

    Messages:
    109
    GitHub:
    Misteboss
    Hello,
    I am trying to do a bash script to open all my server in a different screen (one screen for one server).
    Can someone help me to do this ?
    Thanks ^^
     
  2. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    please describe what you meant
    by what screen?
    screen by joining multiple MCPE servers? or the command line tool called "screen"
    also wrong section, would be more suitable in offtopic
    even tho bash is somewhat related to development but this is reserved to PMMP related only, not even PHP issues should go here
    this would very highly depends on your setup
    you should describe your setup so we can spend most of the time helping you rather than guessing it
     
  3. Miste

    Miste Baby Zombie

    Messages:
    109
    GitHub:
    Misteboss
    Ok si I have a VPS under Debian and I have 8 servers on.
    For the time being I am starting them doing : screen, cd /home/nameoftheserver/, ./start.sh.
    The problem with this technique is that it takes time.
    So if someone can help me to do a script to open them all by tapping a command ^^.

    About the topic location, I'm sorry, can someone move it to an other topic ?

    Thanks
     
  4. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    maybe using multiple start scripts?
    https://forums.pmmp.io/threads/how-to-run-server-indefinitely.2917/#post-29371
    like one for each servers?
    this wouldnt work well unless you put all the servers inside of the user's home dir, due to permission issues
    so inside of /home/user/
    there would be server/(servername)/start.sh
    (may not be the best ideas if the server is not owned by the same person, ex hosting for multiple friends etc)
    and there would be scripts renamed to server name for recognizability
    you can just make a script that calls all the server name.sh start

    only major/minor issue, my script uses TMUX instead of screen

    so your dir would look like
    cwd /home/user/
    ls: server/ server1.sh server2.sh server3.sh startall.sh

    startall.sh will invoke server1.sh start to server3.sh thus starting all of them
    OR use crontab to start them using "server1.sh start" or just use the commands in crontab
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.