Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ## wine btnext.exe script
- ## restart every 12h
- ## crontab -e
- ## * 11,23 * * * /usr/local/bin/btnext >> /home/BTNext/crontab.log
- ## runing vnc4server on boot
- ## Process.exe tool from beyondlogic
- export DISPLAY=:1.0
- cd /home/BTNext
- echo Gracefully closing BTNext
- wine Process.exe -q BTNext.exe
- sleep 30
- ## check if wine still working
- ## wineserver -k
- ## ps -ef | grep '\.exe' | grep -v grep | awk '{ print $2 }' | xargs kill -9
- ## sleep 2
- ## backup settings just in case
- mkdir -p temp
- echo -e "\nSaving Settings"
- zip -9 temp/$(date +%y%m%d.%H).zip _b.ini _t.ini
- ## keep only 40 backup entries
- for files in $(ls -d -1 temp/* | head -n -20); do rm -r $files; done
- ## uncheck if the swap is getting too heavy
- ## echo Cleaning swap
- ## sync; echo 3 > /proc/sys/vm/drop_caches && swapoff -a && swapon -a &
- ## sleep 2
- ## starting wine
- echo Starting BTNext at $(date +%H:%M)
- nohup wine BTNext.exe > /dev/null 2>&1&
Advertisement
Add Comment
Please, Sign In to add comment