-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnode-express
executable file
·35 lines (31 loc) · 996 Bytes
/
node-express
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# Remove code lines causing (drag-)drop minipic error
sed -i~ '/sortEndAction/,+2d' ~/Arbeten/mish/mish-project/node_modules/ember-drag-drop/addon/components/sortable-objects.js
port=3000
# Kill the process (if any) already listening to this port
prid=`lsof -t -i:$port`
if [ $prid ]; then
echo "Port $port occupied by pid $prid"
sudo kill $prid
fi
# Make the script usable from any directory
cd /home/tore/Arbeten/mish
#IMDB_HOME=/mnt/sda2
IMDB_HOME=/mnt/koofrwebdav
IMDB_HOME=/home/tore
#IMDB_ROOT=MISH
IMDB_ROOT=Framkallning_2019
IMDB_ROOT=Album-1
IMDB_ROOT='""' # Empty argument (must be '""') to be passed
################# correctly positioned into '.../node .../server.js'
if [[ $1 ]]; then
IMDB_HOME=$1
if [[ $2 ]]; then
IMDB_ROOT=$2
fi
fi
echo IMDB_HOME = $IMDB_HOME
echo IMDB_ROOT = $IMDB_ROOT
echo -n "##### Starting the Node server "`date`
# Note that Node may be installed as either 'node', 'nodejs', or both:
node server.js $IMDB_HOME $IMDB_ROOT $port