JustOneMoreBlock / shell-scripts

Various Shell Scripts
MIT License
5 stars 7 forks source link

Replacement from restart on reboot. #28

Closed JustOneMoreBlock closed 5 years ago

JustOneMoreBlock commented 6 years ago
#!/bin/bash
# Auto Start: Multicraft

cd /opt/
cat > multicraft.sh << eof
#!/bin/bash
# Auto Start: Multicraft
ps -ef | grep multicraft |grep -v grep > /dev/null
if [ $? != 0 ]
then
       /home/root/multicraft/bin/multicraft start > /dev/null
fi
eof

chmod +x /opt/multicraft.sh

echo "" | crontab -
crontab -l | { cat; echo "*/1 * * * * /opt/multicraft.sh"; } | crontab -
crontab -l