parent
a20142ff64
commit
c59ce48a72
|
@ -3,7 +3,7 @@
|
||||||
# Check if we were effectively run as root
|
# Check if we were effectively run as root
|
||||||
[ $EUID = 0 ] || { echo "This script needs to be run as root!"; exit 1; }
|
[ $EUID = 0 ] || { echo "This script needs to be run as root!"; exit 1; }
|
||||||
|
|
||||||
#Check for 1GB Memory
|
# Check for 1GB Memory
|
||||||
totalk=$(awk '/^MemTotal:/{print $2}' /proc/meminfo)
|
totalk=$(awk '/^MemTotal:/{print $2}' /proc/meminfo)
|
||||||
if [ "$totalk" -lt "1000000" ]; then echo "XOCE Requires at least 1GB Memory!"; exit 1; fi
|
if [ "$totalk" -lt "1000000" ]; then echo "XOCE Requires at least 1GB Memory!"; exit 1; fi
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ xo_server_dir="/opt/xen-orchestra"
|
||||||
systemd_service_dir="/lib/systemd/system"
|
systemd_service_dir="/lib/systemd/system"
|
||||||
xo_service="xo-server.service"
|
xo_service="xo-server.service"
|
||||||
|
|
||||||
#Ensure that git and curl are installed
|
# Ensure that git and curl are installed
|
||||||
/usr/bin/apt-get update
|
/usr/bin/apt-get update
|
||||||
/usr/bin/apt-get --yes install git curl
|
/usr/bin/apt-get --yes install git curl
|
||||||
|
|
||||||
|
@ -34,15 +34,15 @@ echo "$yarn_repo" | tee /etc/apt/sources.list.d/yarn.list
|
||||||
/usr/bin/apt-get update
|
/usr/bin/apt-get update
|
||||||
/usr/bin/apt-get install --yes nodejs yarn
|
/usr/bin/apt-get install --yes nodejs yarn
|
||||||
|
|
||||||
#Install n
|
# Install n
|
||||||
/usr/bin/curl -o $n_location $n_repo
|
/usr/bin/curl -o $n_location $n_repo
|
||||||
/bin/chmod +x $n_location
|
/bin/chmod +x $n_location
|
||||||
/usr/local/bin/n lts
|
/usr/local/bin/n lts
|
||||||
|
|
||||||
#Symbolic Link
|
# Symlink node directories
|
||||||
ln -s /usr/bin/node /usr/local/bin/node
|
ln -s /usr/bin/node /usr/local/bin/node
|
||||||
|
|
||||||
#Install XO dependencies
|
# Install XO dependencies
|
||||||
/usr/bin/apt-get install --yes build-essential redis-server libpng-dev git python-minimal libvhdi-utils nfs-common
|
/usr/bin/apt-get install --yes build-essential redis-server libpng-dev git python-minimal libvhdi-utils nfs-common
|
||||||
|
|
||||||
/usr/bin/git clone -b $xo_branch $xo_server
|
/usr/bin/git clone -b $xo_branch $xo_server
|
||||||
|
@ -61,7 +61,7 @@ sed -i "s|#'/': '/path/to/xo-web/dist/'|'/': '/opt/xen-orchestra/packages/xo-web
|
||||||
#Create node_modules directory if doesn't exist
|
#Create node_modules directory if doesn't exist
|
||||||
mkdir -p /usr/local/lib/node_modules/
|
mkdir -p /usr/local/lib/node_modules/
|
||||||
|
|
||||||
# symlink all plugins
|
# Symlink all plugins
|
||||||
for source in =$(ls -d /opt/xen-orchestra/packages/xo-server-*); do
|
for source in =$(ls -d /opt/xen-orchestra/packages/xo-server-*); do
|
||||||
ln -s "$source" /usr/local/lib/node_modules/
|
ln -s "$source" /usr/local/lib/node_modules/
|
||||||
done
|
done
|
||||||
|
@ -69,7 +69,7 @@ done
|
||||||
if [[ ! -e $systemd_service_dir/$xo_service ]] ; then
|
if [[ ! -e $systemd_service_dir/$xo_service ]] ; then
|
||||||
|
|
||||||
/bin/cat << EOF >> $systemd_service_dir/$xo_service
|
/bin/cat << EOF >> $systemd_service_dir/$xo_service
|
||||||
# systemd service for XO-Server.
|
# Systemd service for XO-Server.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description= XO Server
|
Description= XO Server
|
||||||
|
|
Loading…
Reference in New Issue