summarylogtreecommitdiffstats
path: root/webthings-gateway.sh
blob: 3f8818067ae6cd8bd0e5429d1d96d36815521e1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/bash

if [[ $EUID -ne 0 ]]; then
  echo "Program must be run as root."
  exit 1
fi

if [ ! -d "/etc/webthings-gateway" ]; then
  mkdir "/etc/webthings-gateway"
  chown -R webthings:webthings "/etc/webthings-gateway"
fi

cd /opt/webthings-gateway
setpriv \
  --reuid=webthings \
  --regid=webthings \
  --init-groups \
  --inh-caps=-all \
  node build/gateway.js

# vim:set ts=2 sw=2 et ft=sh: