LAPINPT

wine btnext.exe script

Sep 1st, 2013
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.94 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ## wine btnext.exe script
  4. ## restart every 12h
  5. ## crontab -e
  6. ## * 11,23 * * * /usr/local/bin/btnext >> /home/BTNext/crontab.log
  7. ## runing vnc4server on boot
  8. ## Process.exe tool from beyondlogic
  9.  
  10. export DISPLAY=:1.0
  11.  
  12. cd /home/BTNext
  13.  
  14. echo Gracefully closing BTNext
  15. wine Process.exe -q BTNext.exe
  16.  
  17. sleep 30
  18.  
  19. ## check if wine still working
  20. ## wineserver -k
  21. ## ps -ef | grep '\.exe' | grep -v grep | awk '{ print $2 }' | xargs kill -9
  22. ## sleep 2
  23.  
  24. ## backup settings just in case
  25. mkdir -p temp
  26. echo -e "\nSaving Settings"
  27. zip -9 temp/$(date +%y%m%d.%H).zip _b.ini _t.ini
  28.  
  29. ## keep only 40 backup entries
  30. for files in $(ls -d -1 temp/* | head -n -20); do rm -r $files; done
  31.  
  32. ## uncheck if the swap is getting too heavy
  33. ## echo Cleaning swap
  34. ## sync; echo 3 > /proc/sys/vm/drop_caches && swapoff -a && swapon -a &
  35. ## sleep 2
  36.  
  37. ## starting wine
  38. echo Starting BTNext at $(date +%H:%M)
  39. nohup wine BTNext.exe > /dev/null 2>&1&
Advertisement
Add Comment
Please, Sign In to add comment