Bds-Maneger-CLI-Debian/bin/bds-command

39 lines
975 B
Bash

#!/bin/bash
if [ "$EUID" -ne 0 ]; then
echo "Você não está executando o script com root ou sudo, por favor execute de novo o com: $0 $1"
exit 13
fi
command-send(){
suss='a'
DDs="0"
LLS="$(cat /tmp/mcpe.txt | wc -l)"
screen -S bedrock -p 0 -X stuff "$COMMANDS\n" && suss=0
if [ $suss = '0' ];then
MOD="$(cat /tmp/mcpe.txt)"
echo "Aguarde"
while true
do
if [ "$(cat /tmp/mcpe.txt)" != "$MOD" ]; then
break
fi
done
LLS2="$(cat /tmp/mcpe.txt | wc -l)"
echo "--------- LOG ----------"
cat /tmp/mcpe.txt | tail -n $(($LLS2 - $LLS))
echo "--------- LOG ----------"
COMMANDS=''
fi
}
if [ "$GUI" = 'true' ]
then
COMMANDS="$1 $2 $3 $4 $5 $6 $7 $8"
command-send
else
while [ true ]
do
echo "Para Sair basta usar CTRL + C"
read -rp "Qual é o Comando? " -e COMMANDS
command-send
done
fi