blob: 60de14a7c63a331d60cb354501ab3da94af66471 [file] [log] [blame]
Brian O'Connor8a0c20e2015-09-16 22:54:24 -07001#!/bin/bash
2
3ONOS_USER=sdn
4
5# Check to see if user exists, and if not, create a service account
6getent passwd $ONOS_USER >/dev/null 2&>1 || ( useradd -M $ONOS_USER && usermod -L $ONOS_USER )
7
8# Create ONOS options file
9[ ! -f /opt/onos/options ] && cat << EOF > /opt/onos/options
10export ONOS_OPTS=server
11export ONOS_USER="$ONOS_USER"
12EOF
13
14# Change permissions for onos directory
15[ -d /opt/onos ] && chown -R $ONOS_USER.$ONOS_USER /opt/onos
16