Index menü
#!/bin/bash -e function enable_cgroup_memory() { set +e grep -q '^GRUB_CMDLINE_LINUX=".*cgroup_enable=memory swapaccount=1' /etc/default/grub if [ $? -ne 0 ] then set -e sudo sed -E 's>^(GRUB_CMDLINE_LINUX=")>\1cgroup_enable=memory swapaccount=1 >' /etc/default/grub -i sudo update-grub fi set -e } function enable_user_namespace() { sudo apt-get install linux-generic-lts-trusty set +e if dpkg -l | grep -q '^ii xserver-xorg ' then set -e sudo apt-get install xserver-xorg-lts-trusty libgl1-mesa-glx-lts-trusty fi set -e } function install_lxc() { enable_cgroup_memory enable_user_namespace sudo apt-get install lxc debootstrap bridge-utils lxc-checkconfig } function install_lxc_web() { wget http://lxc-webpanel.github.com/tools/install.sh -O - | sudo bash } function reboot_if_required() { if [ -f /var/run/reboot-required ] then shutdown reboot fi } # MAIN install_lxc install_lxc_web reboot_if_required