0

Hi :) I was wondering if you guys could help me figure something out... Im trying to make a startup script for Spigot server and I want it to start a screen session called "minecraft" and then write "The servers will start in 10 seconds". Ive been trying for a couple days to research and get it on my own but I cant figure it out :) I didn't post it there because I find most of my answers about screen on here. what I have is:

#!/bin/sh
cd /home/westwolf/Spigot
screen -S "minecraft"
screen -x "minecraft" -X stuff "BlackShipCraft on Spigot 1.8.8 will boot in 10 seconds"
screen -x "minecraft" -X eval "stuff \015"

I think this should be fairly simple for someone with more experience...I think I'm making a simple mistake.. I can get the screen session called "minecraft", but the only way I can get it to say say things is to send it from another gnome terminal...

2
  • sorry about the boldness and stuff not being in order...it is when I pasted it. If you tell me how not to correct that it wont happen again :)
    – Westwolf
    Sep 21, 2015 at 9:47
  • anyone have any advice? :)
    – Westwolf
    Sep 25, 2015 at 19:25

1 Answer 1

0

I fixed it. I made an init.d script to start minecraft at boot. It runs as user westwolf, me, and NOT root, because running as root made things a pain...

http://pastebin.com/hvwfjBrj

I made a few other scripts for crontab jobs, like a noon reboot and an auto backup. For an ingame reboot my sh looks like this, and can be set as the "Restart Scripts" in spigot.yml, and used in the game as /restart:

!/bin/bash

echo "YOUR PASSWORD" | sudo -S reboot exit

If interested in a safe backup script, mine looks like this:

http://pastebin.com/DjVXhuae

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .