123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #!/usr/bin/env bash
- set -e
- SNAC_PID=$(pidof snac)
- SNAC_DIR=/var/lib/snac
- SNAC_VERB=$1
- shift
- if [ -z $SNAC_PID ]; then
- echo "no such process" >&2
- exit 1
- fi
- if [ $(id -u) -ne 0 ]; then
- echo "not root" >&2
- exit 1
- fi
- if [ ! -d $SNAC_DIR ]; then
- echo "$SNAC_DIR is not a directory" >&2
- exit 1
- fi
- if [ -z $SNAC_VERB ]; then
- echo "no arguments" >&2
- exit 1
- fi
- nsenter -ae -S follow -G follow -t $SNAC_PID -- snac $SNAC_VERB $SNAC_DIR $@
|