This commit is contained in:
Case Duckworth 2020-04-10 18:49:04 +00:00
parent 4ad48ccc43
commit 247be8ef6d
1 changed files with 9 additions and 2 deletions

View File

@ -129,15 +129,22 @@ bakerdemote()
done
groups="$(getent group|grep "$user"|cut -d: -f1|"${_sed[@]}"|tr '\n' ',')"
log "Applying changes"
usermod -G "${groups%,}" && ok
usermod -G "${groups%,}" "$user" && ok
}
main()
{ # entry point
(( $# == 0 )) && usage 1
cmd="$1"; shift || die "Not enough arguments for \"$cmd\""
case "$cmd" in
help|h)
help|h|usage|-h|--help)
(( $# == 0 )) && usage 0
grep -q "baker$1" "$0" && {
echo "baker $1"
awk "BEGIN{FS=\"\\n\";RS=\"\";}/baker$1/{print}" "$0" |
sed -n 's/# //p'
exit
} || die "No command \"$1\""
;;
add|hire)
cmd=add ;;