Advertisement
Guest User

Untitled

a guest
May 13th, 2012
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.94 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. #
  4. # README!
  5. # Please put this script on a level upper of your ubilling installation
  6. # backup manually directory billing at first time before running this updater
  7. # Если Убиллинг установлен в /var/www/billing
  8. # Скрипт автообновления должен лежать в /var/www
  9.  
  10. # fetch software (Для Linux тут wget, а не fetch)
  11. FETCH="wget"
  12.  
  13. echo "=== Ubilling auto update ==="
  14. cd ./billing/
  15.  
  16. echo "=== Backup current data ==="
  17. mkdir ../ub_restore
  18. rm -fr ../ub_restore/*
  19. mkdir ../ub_restore/config
  20. mkdir ../ub_restore/content
  21. #mkdir ../ub_restore/multinet
  22. mkdir ../ub_restore/userstats
  23. mkdir ../ub_restore/userstats/config
  24.  
  25. #Custom modules
  26. #Тут лежит мой модуль для контроля шейпа, можно этот кусок не делать
  27. mkdir ../ub_restore/modules
  28. mkdir ../ub_restore/modules/general
  29. mkdir ../ub_restore/modules/general/pl_scinfo
  30. mkdir ../ub_restore/skins
  31. # все дальше как обычно
  32.  
  33. cp .htaccess ../ub_restore/
  34. cp favicon.ico ../ub_restore/
  35. cp -R ./multinet ../ub_restore/
  36. cp ./config/alter.ini ../ub_restore/config/
  37. cp ./config/billing.ini ../ub_restore/config/
  38. cp ./config/mysql.ini ../ub_restore/config/
  39. cp ./config/bmagic.ini ../ub_restore/config/
  40. cp -R ./config/dhcp ../ub_restore/config/
  41. cp -R ./content/users ../ub_restore/content/
  42. cp ./config/printcheck.tpl ../ub_restore/config/
  43. cp ./userstats/config/mysql.ini ../ub_restore/userstats/config/
  44. cp ./userstats/config/userstats.ini ../ub_restore/userstats/config/
  45.  
  46. #Custom modules
  47. #Тут лежит мой модуль для контроля шейпа, можно этот кусок не делать
  48. cp ./modules/general/pl_scinfo/index.php ../ub_restore/modules/general/pl_scinfo/
  49. cp ./modules/general/pl_scinfo/module.php ../ub_restore/modules/general/pl_scinfo/
  50. cp ./skins/speed.png  ../ub_restore/skins/
  51. # все дальше как обычно
  52.  
  53. echo "=== Cleanup ==="
  54. rm -fr ./*
  55. echo "=== Downloading new release ==="
  56. $FETCH http://ubilling.net.ua/ub.tgz
  57.  
  58. echo "=== Unpacking ==="
  59. tar zxvf ub.tgz
  60.  
  61. echo "=== Restoring configs ==="
  62. cp -R ../ub_restore/* ./
  63.  
  64. #kill default admin
  65. #rm -fr ./content/users/admin
  66.  
  67. echo "=== Linking True Online ==="
  68. ln -fs /etc/stargazer/dn /var/www/billing/content/dn
  69.  
  70. echo "=== Linking Multinet  ==="
  71. rm -fr ./multinet
  72. ln -dfs /etc/dhcp3 /var/www/billing/multinet
  73.  
  74. echo "=== Setting permissions ==="
  75. chmod -R 777 content/ config/ multinet/ exports/ remote_nas.conf vservices.php
  76.  
  77. #Custom modules
  78. #Тут лежит мой модуль для контроля шейпа, можно этот кусок не делать
  79. echo "=== echo translation  ==="
  80. echo '$lang'"['def']['right to show sc info for user']='Право на просмотр информации о скорости пользователя';" >> ./languages/russian/billing.php
  81. # все дальше как обычно
  82.  
  83. echo "===Update complete ==="
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement