Skip to content

Instantly share code, notes, and snippets.

@altucor
Created October 11, 2020 22:29

Revisions

  1. altucor renamed this gist Oct 11, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt → overviwer.service
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    # NOTE: this file tested in container which runs minecraft server and overviwer and all things works under root permissions
    root@minecraft:~# cat /etc/systemd/system/overviewer.service
    # root@minecraft:~# cat /etc/systemd/system/overviewer.service
    [Unit]
    Description=Overviewer Minecraft map generator
    After=minecraft.service
  2. altucor created this gist Oct 11, 2020.
    24 changes: 24 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    # NOTE: this file tested in container which runs minecraft server and overviwer and all things works under root permissions
    root@minecraft:~# cat /etc/systemd/system/overviewer.service
    [Unit]
    Description=Overviewer Minecraft map generator
    After=minecraft.service

    [Service]
    Type=oneshot
    WorkingDirectory=/root/overviewer/
    ExecStart=/usr/bin/screen -p 0 -S mc-0 -X eval 'stuff "say DISABLING SERVER SAVE FEATURE"^M'
    ExecStart=/usr/bin/screen -p 0 -S mc-0 -X eval 'stuff "save-off"^M'
    ExecStart=/usr/bin/screen -p 0 -S mc-0 -X eval 'stuff "say SAVING SERVER MAP"^M'
    ExecStart=/usr/bin/screen -p 0 -S mc-0 -X eval 'stuff "save-all"^M'
    ExecStart=/usr/bin/screen -p 0 -S mc-0 -X eval 'stuff "say STARTING MAP RENDERING"^M'
    ExecStart=/root/overviewer/map_generate_cfg.sh
    ExecStart=/usr/bin/screen -p 0 -S mc-0 -X eval 'stuff "say FINISHED RENDERING MAP https://your-domain.com"^M'
    ExecStart=/usr/bin/screen -p 0 -S mc-0 -X eval 'stuff "say ENABLING SERVER SAVE FEATURE"^M'
    ExecStart=/usr/bin/screen -p 0 -S mc-0 -X eval 'stuff "save-on"^M'

    User=root
    Group=root

    [Install]
    WantedBy=multi-user.target