From c372315963b47c1ed1d365ae9a792edfe00bcfeb Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sat, 30 Sep 2017 18:08:56 -0500 Subject: system/adelie-base: add bbshim crap to it --- system/adelie-base/addgroup | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 system/adelie-base/addgroup (limited to 'system/adelie-base/addgroup') diff --git a/system/adelie-base/addgroup b/system/adelie-base/addgroup new file mode 100755 index 000000000..051df3696 --- /dev/null +++ b/system/adelie-base/addgroup @@ -0,0 +1,36 @@ +#!/bin/sh +# addgroup - BusyBox compatibility shim +# bbshim +# +# Copyright © 2017 A. Wilcox. All rights reserved. +# Licensed under the terms of the NCSA Open Source license. +# + +ARG= +CMDLINE= + +while getopts :g:S ARG +do + case $ARG in + g) CMDLINE="$CMDLINE -g \"$OPTARG\"" ;; + S) CMDLINE="$CMDLINE -r" ;; + :) exit 1 ;; + \?) exit 1 ;; + esac +done + +shift $(($OPTIND - 1)) + +if [ -z "$*" ]; then + echo "$0: group name is required" >&2 + exit 1 +fi + +set "$@" + + +if [ -n "$2" ]; then + exec usermod -a -G $2 $1 +fi + +groupadd $CMDLINE $1 -- cgit v1.2.3-70-g09d2