summarylogtreecommitdiffstats
path: root/webthings-gateway.sh
blob: ef6c895c5ba187887d615049d92c7cd693275a45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/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
su -c "node build/gateway.js" webthings

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