sudo ps -aux|grep supervisord |grep -v grep|awk '{print $2}'|sudo xargs kill
sudo ps -aux|grep laravel-echo-server |grep -v grep|awk '{print $2}'|sudo xargs kill
#sudo ps -aux|grep artisan |grep -v grep|awk '{print $2}'|sudo xargs kill
sudo ps -aux|grep goExport |grep -v grep|awk '{print $2}'|sudo xargs kill

cd /var/www/was
nohup sudo su root -c "laravel-echo-server start" >/dev/null 2>&1 &
nohup sudo su baoshi -c "sudo supervisord -c /var/www/was/horizon.conf" >/dev/null 2>&1 &
#nohup sudo su baoshi -c "php artisan queue:work --tries=2 --delay=2" >/dev/null 2>&1 &
nohup sudo ./serves/goExports >/dev/null 2>&1 &


isExistStr=$(cat /etc/crontab|grep '* * * * * root cd /var/www/was && php artisan schedule:run >> /dev/null 2>&1')
if [ ! -n "$isExistStr" ]; then
sudo echo -e '\n* * * * * root cd /var/www/was && php artisan schedule:run >> /dev/null 2>&1' >> /etc/crontab
fi
sudo systemctl restart crond

