Newer
Older
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
#
# start mods server
#
# Neil Gershenfeld
# (c) Massachusetts Institute of Technology 2016
#
# This work may be reproduced, modified, distributed, performed, and
# displayed for any purpose, but must acknowledge the fab modules
# project. Copyright is retained and must be preserved. The work is
# provided as is; no warranty is provided, and users accept all
# liability.
#
# find path, following symlinks
# from http://www.ostricher.com/2014/10/the-right-way-to-get-the-directory-of-a-bash-script/
#
#get_script_dir () {
# SOURCE="${BASH_SOURCE[0]}"
# while [ -h "$SOURCE" ]; do
# DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
# SOURCE="$( readlink "$SOURCE" )"
# [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
# done
# DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
# echo "$DIR"
# }
#path=$(get_script_dir)
#
# hard-code script path
#
path="/usr/local/bin/mods/scripts"
#
# cd to script
#
cd $path
cd ..
#
# uncomment to start local http server (ignores error if already running)
#
#http-server -p 8080 &
#
# uncomment to start node print server (ignores error if already running)
# for printer permission:
# sudo adduser user_name lp
# sudo adduser user_name lpadmin
#
cd js
node printserver.js 127.0.0.1 1234 &
zenity --info --text 'mods printserver started'
#
# uncomment to start node serial server (ignores error if already running)
# for serial permission:
# sudo adduser user_name dialout
#
#cd js
#node serialserver.js 127.0.0.1 1234 &
#zenity --info --text 'mods serialserver started'