Initial commit

This commit is contained in:
Janik
2021-05-06 13:52:11 +02:00
commit f271f67049
6 changed files with 142 additions and 0 deletions

17
update_index.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh
pgrep -U 1001 java > /dev/null
#state=$(pgrep java | head -n1 - | xargs ps -o s= -p)
#if [ $state = 'T' ]
#then
# pgrep java | head -n 1 - | xargs pwdx | xargs -d '\n' basename | xargs -d '\n' -i sed -i -e 's|<h2>.*</h2>|<h2>Zurzeit ist der Server suspendiert. Modpack: {}</h2>|g' /usr/share/nginx/minecraft/index.html
#else
if [ $? -eq 0 ]
then
pgrep java -U 1001 | head -n 1 - | xargs pwdx | xargs -d '\n' basename | xargs -d '\n' -i sed -i -e 's|<h2>.*</h2>|<h2>Zurzeit läuft: {}</h2>|g' /usr/share/nginx/minecraft/index.html
else
sed -i -e 's|<h2>.*</h2>|<h2>Zurzeit läuft der Server nicht.</h2>|g' /usr/share/nginx/minecraft/index.html
fi
#fi