Initial commit
This commit is contained in:
17
update_index.sh
Executable file
17
update_index.sh
Executable 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
|
||||
Reference in New Issue
Block a user