ansible-playbooks/roles/auth/files/become_club

19 lines
336 B
Bash
Executable File

#!/bin/sh
if test -z "$1"; then
echo >&2 'usage: become_club clubaccount'
echo >&2 ' become_club -l'
exit 2
fi
if test "$(whoami)" = "$1"; then
echo >&2 you are already $1
exit 1
fi
if test -z "$SHELL"; then
export SHELL=/bin/bash
fi
if test "$1" = -l; then
sudo -l
else
exec sudo -H -s -u "$1"
fi