Results 1 to 4 of 4

Thread: how do I run a .sh file with terminal

  1. #1
    Join Date
    Nov 2012
    Beans
    7

    how do I run a .sh file with terminal

    Hi, I was trying to make my minecraft srever run at startup, (it's craftbukkit-1.4.5). Right now I have the startup applications runing my .sh file to start it:
    Code:
    !#/bin/sh
    cd /home/[user]/[subfolder]/[folder]
    sh bukkit.sh
    and my bukkit.sh is:
    Code:
    #!/bin/sh
     BINDIR=$(dirname "$(readlink -fn "$0")")
     cd "$BINDIR"
     /home/kinetos/java/jre1.7.0_09/bin/java -Xmx6144M -Xms6144M -jar craftbukkit-1.4.5-R0.2.jar -o true
    but whenever it runs at startup, the terminal doesn't open, and my minecraft server is running without any way for me to run commands as [server].
    How can I edit my .sh files to open terminal and keep it running?

    Thanks for any help,
    ~Kinetos

  2. #2
    Join Date
    Nov 2008
    Location
    Sheffield, UK
    Beans
    1,516
    Distro
    Ubuntu

    Re: how do I run a .sh file with terminal

    use screen


    Code:
    #!/bin/sh
     BINDIR=$(dirname "$(readlink -fn "$0")")
     cd "$BINDIR"
     screen /home/kinetos/java/jre1.7.0_09/bin/java -Xmx6144M -Xms6144M -jar craftbukkit-1.4.5-R0.2.jar -o true

    then to get to the session use

    Code:
    screen -r

  3. #3
    Join Date
    Feb 2011
    Location
    Somewhere...
    Beans
    1,543
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: how do I run a .sh file with terminal

    If you want to keep the terminal open, instead of calling the script directly, try running the terminal first:
    Code:
    gnome-terminal --command=/path/to/bukkit.sh

  4. #4
    Join Date
    Nov 2012
    Beans
    7

    Re: how do I run a .sh file with terminal

    Quote Originally Posted by zombifier25 View Post
    If you want to keep the terminal open, instead of calling the script directly, try running the terminal first:
    Code:
    gnome-terminal --command=/path/to/bukkit.sh
    Awesome! That fixed it! Thanks zombifier25!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •