18 |
|
|
19 |
|
|
20 |
|
|
|
|
|
21 |
function restartxo { |
function restartxo { |
22 |
killall -9 node |
killall -9 node |
23 |
rm -f /root/forever.log |
rm -f /root/forever.log |
29 |
exit |
exit |
30 |
fi |
fi |
31 |
|
|
32 |
|
|
33 |
|
phymem=$(free -m|awk '/^Mem:/{print $2}') |
34 |
|
swapmem=$(free -m|awk '/^Swap:/{print $2}') |
35 |
|
total=$(expr $phymem + $swapmem) |
36 |
|
if [ $total -le 1536 ] ; then |
37 |
|
echo not enough memory: $total |
38 |
|
exit |
39 |
|
fi |
40 |
|
|
41 |
if [ "$1" == "clean" ] ; then |
if [ "$1" == "clean" ] ; then |
42 |
echo cleaning xo-web |
echo cleaning xo-web |
43 |
rm -rf xo-web |
rm -rf xo-web |
121 |
|
|
122 |
if [ ! -d "/usr/local/lib/node_modules/bcrypt" ] ; then |
if [ ! -d "/usr/local/lib/node_modules/bcrypt" ] ; then |
123 |
echo "installing bcrypt" |
echo "installing bcrypt" |
124 |
npm install -g bcrypt || exit |
npm install -g --unsafe-perm bcrypt || exit |
125 |
fi |
fi |
126 |
|
|
127 |
if [ ! -d "xo-web" ] ; then |
if [ ! -d "xo-web" ] ; then |
203 |
echo Installing plugins |
echo Installing plugins |
204 |
npm install --global xo-server-transport-email |
npm install --global xo-server-transport-email |
205 |
npm install --global xo-server-transport-xmpp |
npm install --global xo-server-transport-xmpp |
206 |
|
npm install --global xo-server-backup-reports |
207 |
|
|
208 |
#npm install --save xo-server-usage-report |
#npm install --save xo-server-usage-report |
209 |
|
|
210 |
|
|