Advertisement
Guest User

Untitled

a guest
Aug 30th, 2017
630
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.91 KB | None | 0 0
  1. # Fixes:
  2. # - moved from http to https where possible
  3. # - tons of performance tweaks
  4. #
  5. # Not addressed:
  6. # - systemctl disable log2ram
  7. # - rm /etc/cron.daily/log2ram
  8. # - /etc/cron.d/make_nas_processes_faster including HMP fix for octa-core boards
  9. # - ODROID-XU4 Cloudshell 2 stuff
  10.  
  11. install_omv (){
  12. #------------------------------------------------------------------------------------------------------------------------------------------
  13. # Install OpenMediaVault 3
  14. #------------------------------------------------------------------------------------------------------------------------------------------
  15. if [ $distribution != "jessie" ]; then
  16. dialog --backtitle "$backtitle" --title "Dependencies not met" --msgbox "\nOpenMediaVault 3 can only be installed on Debian Jessie." 7 52
  17. sleep 5
  18. exit
  19. fi
  20. apt-get --yes --force-yes --allow-unauthenticated install openmediavault-keyring
  21. apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7AA630A1EDEE7D73
  22.  
  23. cat > /etc/apt/sources.list.d/openmediavault.list << EOF
  24. deb https://openmediavault.github.io/packages/ erasmus main
  25.  
  26. ## Uncomment the following line to add software from the proposed repository.
  27. deb https://openmediavault.github.io/packages/ erasmus-proposed main
  28.  
  29. ## This software is not part of OpenMediaVault, but is offered by third-party
  30. ## developers as a service to OpenMediaVault users.
  31. # deb https://openmediavault.github.io/packages/ erasmus partner
  32. EOF
  33.  
  34. debconf-apt-progress -- apt-get update
  35. debconf-apt-progress -- apt-get -y install openmediavault postfix
  36. URL='https://github.com/OpenMediaVault-Plugin-Developers/packages/raw/master/openmediavault-omvextrasorg_latest_all3.deb'; FILE=`mktemp`; wget "$URL" -qO $FILE && dpkg -i $FILE; rm $FILE
  37. /usr/sbin/omv-update
  38.  
  39. # Install flashmemory plugin and netatalk by default, use nice logo for the latter,
  40. # Disable OMV monitoring by default
  41. . /usr/share/openmediavault/scripts/helper-functions
  42. apt-get -y -q install openmediavault-netatalk openmediavault-flashmemory
  43. AFP_Options="mimic model = Macmini"
  44. SMB_Options="min receivefile size = 16384\nwrite cache size = 524288\ngetwd cache = yes\nsocket options = TCP_NODELAY IPTOS_LOWDELAY"
  45. xmlstarlet ed -L -u "/config/services/afp/extraoptions" -v "$(echo -e "${AFP_Options}")" /etc/openmediavault/config.xml
  46. xmlstarlet ed -L -u "/config/services/smb/extraoptions" -v "$(echo -e "${SMB_Options}")" ${OMV_CONFIG_FILE}
  47. xmlstarlet ed -L -u "/config/services/flashmemory/enable" -v "1" /etc/openmediavault/config.xml
  48. xmlstarlet ed -L -u "/config/services/ssh/enable" -v "1" /etc/openmediavault/config.xml
  49. xmlstarlet ed -L -u "/config/services/ssh/permitrootlogin" -v "1" /etc/openmediavault/config.xml
  50. xmlstarlet ed -L -u "/config/system/time/ntp/enable" -v "1" /etc/openmediavault/config.xml
  51. read TZ </etc/timezone
  52. xmlstarlet ed -L -u "/config/system/time/timezone" -v "${TZ}" /etc/openmediavault/config.xml
  53. read HOSTNAME </etc/hostname
  54. xmlstarlet ed -L -u "/config/system/network/dns/hostname" -v "${HOSTNAME}" /etc/openmediavault/config.xml
  55. /usr/sbin/omv-rpc -u admin "perfstats" "set" '{"enable":false}'
  56. /usr/sbin/omv-rpc -u admin "config" "applyChanges" '{ "modules": ["monit","rrdcached","collectd"],"force": true }'
  57. sed -i 's|-j /var/lib/rrdcached/journal/ ||' /etc/init.d/rrdcached
  58. /usr/sbin/omv-mkconf netatalk
  59. /usr/sbin/omv-mkconf samba
  60. /usr/sbin/omv-mkconf flashmemory
  61. /usr/sbin/omv-mkconf ssh
  62. /usr/sbin/omv-mkconf ntp
  63. /usr/sbin/omv-mkconf timezone
  64. /usr/sbin/omv-mkconf monit
  65. /usr/sbin/omv-mkconf rrdcached
  66. /usr/sbin/omv-mkconf collectd
  67. /sbin/folder2ram -enablesystemd
  68.  
  69. # Prevent accidentally destroying board performance by clicking around in OMV UI
  70. . /etc/default/cpufrequtils
  71. echo -e "OMV_CPUFREQUTILS_GOVERNOR=${GOVERNOR}" >>/etc/default/openmediavault
  72. echo -e "OMV_CPUFREQUTILS_MINSPEED=${MIN_SPEED}" >>/etc/default/openmediavault
  73. echo -e "OMV_CPUFREQUTILS_MAXSPEED=${MAX_SPEED}" >>/etc/default/openmediavault
  74.  
  75. omv-initsystem
  76. check_port 80
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement