Skip to content

Instantly share code, notes, and snippets.

@androidovshchik
Last active January 9, 2020 04:28
Show Gist options
  • Save androidovshchik/56fc89224815ccabaad909778d31ba44 to your computer and use it in GitHub Desktop.
Save androidovshchik/56fc89224815ccabaad909778d31ba44 to your computer and use it in GitHub Desktop.
#!/bin/bash
ps aux | grep proexpert | awk '{print $2}' | xargs /bin/kill
#!/bin/bash
nohup java -jar /home/proexpert.jar &
#!/bin/bash
### BEGIN INIT INFO
# Provides: proexpert
# Required-Start: $all
# Required-Stop:
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Short-Description: PROEXPERT
### END INIT INFO
case $1 in
start)
/bin/bash /home/proexpert-start.sh
;;
stop)
/bin/bash /home/proexpert-stop.sh
;;
restart)
/bin/bash /home/proexpert-stop.sh
/bin/bash /home/proexpert-start.sh
;;
esac
exit 0
apt-get update
apt-get install apache2 -y
apt-get install mysql-server -y
apt-get install php libapache2-mod-php php-mysql -y
apt-get install phpmyadmin php-mbstring php-gettext -y
apt-get install openjdk-8-jdk -y
reboot
chmod 755 /etc/init.d/proexpert
update-rc.d proexpert defaults
systemctl daemon-reload
systemctl start proexpert
mysql -u root
CREATE USER 'remote'@'%' IDENTIFIED BY 'mypass';
CREATE USER 'proexpert'@'localhost' IDENTIFIED BY 'mypass';
GRANT ALL ON *.* TO 'remote'@'%';
GRANT ALL ON *.* TO 'proexpert'@'localhost';
flush privileges;
exit;
# bind-address = 0.0.0.0
crontab -e
*/5 * * * * sh /home/proexpert-restart.sh
#!/bin/bash
if ! pgrep -x "proexpert" > /dev/null; then
sh /home/proexpert-start.sh
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment