Guest User

Untitled

a guest
Dec 2nd, 2016
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. #!/bin/bash
  2. #set +x
  3. killserver=0
  4. notifydebug=0
  5. maintaince=0
  6. notneededoutput="/dev/null" #/home/steam/arma3 #armataskname
  7. backupdir="backups"
  8. logdir="logs"
  9. armalog1="armac.log"
  10. armalog2="armar.log"
  11. time=`date +%b-%d-%y`
  12. ##########################################################################################################################################################
  13. #pushb () {
  14. # i=$1
  15. # #pushb $i > $notneededoutput
  16. # return 0
  17. #}
  18. #if [ $maintaince = "1" ]
  19. # then
  20. # echo "MAINTAINCE MODE"
  21. # exit 1
  22. #fi
  23. #if [ $killserver = "1" ]
  24. # then
  25. # pkill arma3server
  26. #fi
  27. #if [ $notifydebug = "1" ]
  28. # then
  29. # #pushb "test"
  30. #fi
  31. if pgrep arma3server > $notneededoutput #if server is started then
  32. then
  33. echo "" > $notneededoutput
  34. else
  35. echo "===========$(date)==========="
  36. #find . -wholename "*.log" -size +1000k -delete
  37. ##pushb "Server not started" > $notneededoutput
  38. echo =============================
  39. echo Server NOT started
  40. H=$(date +%H)
  41. if (( 5 <= 10#$H && 10#$H < 9 ))
  42. then
  43. echo Time is 5 to 9
  44. echo Starting Backup
  45. if [ -f /home/steam/backups/arma3backup$time.tar.gz ];
  46. then
  47. echo "There is an Backup already"
  48. else
  49. echo "No Backup yet"
  50. tar -cvpzf /home/steam/backups/arma3backup$time.tar.gz ../arma3
  51. #pushb "Making Backup" > $notneededoutput
  52. fi
  53. echo End Of Backup
  54. echo Deleting Old Backups?
  55. find /home/steam/backups -mindepth 1 -mtime +7 -delete
  56. else
  57. echo Just Restarting
  58. ##pushb "Just Restarting" > $notneededoutput
  59. fi
  60. ./arma3server -par=arma3server_startup_parameters.txt > $logdir/$armalog1 2> $logdir/$armalog2 &
  61. if pgrep arma3server > $notneededoutput
  62. then
  63. #pushb "Server started" > $notneededoutput
  64. echo "Server started"
  65. else
  66. #pushb "Server could not start" > $notneededoutput
  67. echo "" > $notneededoutput
  68. fi
  69. #nice -n -19
  70. echo =============================
  71. fi
  72. ##########################################################################################################################################################
Add Comment
Please, Sign In to add comment