Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2016
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.26 KB | None | 0 0
  1. #!/bin/bash
  2. if [ -f ".dev-debug" ]; then
  3. exec 5>dev-debug.log
  4. BASH_XTRACEFD="5"
  5. set -x
  6. fi
  7. version="210516"
  8. emailalert="off"
  9. email=""
  10. pushbulletalert="off"
  11. pushbullettoken=""
  12. steamuser="hidden"
  13. steampass="hidden"
  14. ip="my.ipv4.is.specified.here"
  15. port="2302"
  16. updateonstart="off"
  17. fn_parms(){
  18. parms="-netlog -ip=${ip} -port=${port} -cfg=${networkcfgfullpath} -config=${servercfgfullpath} -mod=${mods} -servermod=${servermods} -bepath=${bepath} -autoinit -loadmissiontomemory"
  19. }
  20. mods=""
  21. servermods=""
  22. bepath=""
  23. githubuser="dgibbs64"
  24. githubrepo="linuxgsm"
  25. githubbranch="master"
  26. appid="233780"
  27. servicename="arma"
  28. gamename="ARMA 3"
  29. engine="realvirtuality"
  30. rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
  31. selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  32. lockselfname=".${servicename}.lock"
  33. lgsmdir="${rootdir}/lgsm"
  34. functionsdir="${lgsmdir}/functions"
  35. filesdir="${rootdir}/arma"
  36. systemdir="${filesdir}"
  37. executabledir="${filesdir}"
  38. executable="./arma3server"
  39. servercfg="${servicename}.server.cfg"
  40. networkcfg="${servicename}.network.cfg"
  41. servercfgdir="${systemdir}/cfg"
  42. servercfgfullpath="${servercfgdir}/${servercfg}"
  43. networkcfgfullpath="${servercfgdir}/${networkcfg}"
  44. servercfgdefault="${servercfgdir}/lgsm-default.server.cfg"
  45. networkcfgdefault="${servercfgdir}/lgsm-default.network.cfg"
  46. backupdir="${rootdir}/backups"
  47. logdays="7"
  48. scriptlogdir="${rootdir}/log/script"
  49. consolelogdir="${rootdir}/log/console"
  50. consolelogging="on"
  51. scriptlog="${scriptlogdir}/${servicename}-script.log"
  52. consolelog="${consolelogdir}/${servicename}-console.log"
  53. emaillog="${scriptlogdir}/${servicename}-email.log"
  54. scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
  55. consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"
  56. fn_fetch_core_dl(){
  57. github_file_url_dir="lgsm/functions"
  58. github_file_url_name="${functionfile}"
  59. filedir="${functionsdir}"
  60. filename="${github_file_url_name}"
  61. githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
  62. if [ ! -f "${filedir}/${filename}" ]; then
  63. if [ ! -d "${filedir}" ]; then
  64. mkdir -p "${filedir}"
  65. fi
  66. echo -e " fetching ${filename}...\c"
  67. curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
  68. for curlcmd in ${curlpaths}
  69. do
  70. if [ -x "${curlcmd}" ]; then
  71. break
  72. fi
  73. done
  74. if [ "$(basename ${curlcmd})" == "curl" ]; then
  75. curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
  76. if [ $? -ne 0 ]; then
  77. echo -e "\e[0;31mFAIL\e[0m\n"
  78. echo "${curlfetch}"
  79. echo -e "${githuburl}\n"
  80. exit 1
  81. else
  82. echo -e "\e[0;32mOK\e[0m"
  83. fi
  84. else
  85. echo -e "\e[0;31mFAIL\e[0m\n"
  86. echo "Curl is not installed!"
  87. echo -e ""
  88. exit 1
  89. fi
  90. chmod +x "${filedir}/${filename}"
  91. fi
  92. source "${filedir}/${filename}"
  93. }
  94.  
  95. core_dl.sh(){
  96. functionfile="${FUNCNAME}"
  97. fn_fetch_core_dl
  98. }
  99.  
  100. core_functions.sh(){
  101. functionfile="${FUNCNAME}"
  102. fn_fetch_core_dl
  103. }
  104.  
  105. core_dl.sh
  106. core_functions.sh
  107.  
  108. getopt=$1
  109. core_getopt.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement