You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
336 B
19 lines
336 B
6 years ago
|
#!/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
|