Skip to content
Snippets Groups Projects
Commit 358bcf83 authored by Bob Mottram's avatar Bob Mottram
Browse files

Etherpad app

parent bdae9792
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,10 @@ VARIANTS='mesh'
NODEJS_VERSION='6.2.2'
NODEJS_N_VERSION='2.1.4'
# This file keeps track of the apps needing nodejs
# so that it can be removed if tere are no apps which need it
NODEJS_INSTALLED_APPS_FILE=$HOME/.nodejs-apps
function mesh_install_nodejs {
chroot "${rootdir}" apt-get -yq install nodejs
chroot "${rootdir}" apt-get -yq install npm curl
......@@ -65,6 +69,31 @@ EOF
chroot "${rootdir}" rm -f /root/install-nodejs.sh
}
function remove_nodejs {
if [ ! $1 ]; then
return
fi
if [ ! -f $NODEJS_INSTALLED_APPS_FILE ]; then
return
fi
sed -i "/install_${1}/d" $NODEJS_INSTALLED_APPS_FILE
if ! grep "install_" $NODEJS_INSTALLED_APPS_FILE; then
apt-get -yq remove --purge nodejs
if [ -f /usr/bin/nodejs ]; then
rm /usr/bin/nodejs
fi
if [ -f /usr/local/bin/node ]; then
rm /usr/local/bin/node
fi
if [ -f /usr/bin/node ]; then
rm /usr/bin/node
fi
rm $NODEJS_INSTALLED_APPS_FILE
fi
}
function install_nodejs {
if [ $INSTALLING_MESH ]; then
mesh_install_nodejs
......@@ -101,6 +130,12 @@ EOF
fi
rm -f /root/install-nodejs.sh
if [ $1 ]; then
if ! grep "install_${1}" $NODEJS_INSTALLED_APPS_FILE; then
echo "install_${1}" >> $NODEJS_INSTALLED_APPS_FILE
fi
fi
mark_completed $FUNCNAME
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment