-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathdstart
More file actions
executable file
·34 lines (30 loc) · 1.04 KB
/
dstart
File metadata and controls
executable file
·34 lines (30 loc) · 1.04 KB
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
#!/bin/bash
CMD=$0
[ "${CMD:0:1}" != "/" ] && CMD="$PWD/$CMD"
APP=$(dirname "$CMD")
APP="$APP/sdcard/DroidScript/droidscript-web/server/dserve.js"
main() {
cd "$HOME" # Share node_modules with other node apps
# Below, choose correct binary modules for our architecture
v=$(uname -m)
if [ "$v" = "armv6l" ]; then
dir="node_modules/fibers/bin/linux-arm-48"
if [ ! -d "$dir" -a -f linux-arm-48_fibers.node ]; then
mkdir -p "$dir"
ln linux-arm-48_fibers.node "$dir/fibers.node"
fi
/home/pi/node-armv6l "$APP"
elif [ "$v" = "armv7l" ]; then
dir="node_modules/fibers/bin/linux-arm-51"
if [ ! -d "$dir" -a -f linux-arm-51_fibers.node ]; then
mkdir -p "$dir"
ln linux-arm-51_fibers.node "$dir/fibers.node"
fi
node "$APP"
else
node "$APP"
fi
}
clear
echo "Starting $APP..."
main