aboutsummaryrefslogtreecommitdiff
path: root/nitro@/common
blob: bd0e3001b93bee49256de584321489c1f441ea1b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
# before sourcing, set USER="$1"

[ -r ./conf ] && . ./conf
# this lets you create configs per-user
[ -r ./conf."$USER" ] && . ./conf."$USER"

UID=$(id -u "$USER")
GID=$(id -g "$USER")

: ${HOME:=$(getent passwd "$USER" | cut -d: -f6)} \
  ${CONFDIR:="$HOME"/.config/nitro} \
  ${CHPSTUSER:=:$UID:$(id -G "$USER" | tr ' ' ':')} \
  ${SOCKDIR:=${SOCKET_PREFIX:-/run/user}/$UID}

export USER HOME NITRO_SOCK="$SOCKDIR"/nitro/nitro.sock