Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.2
sysuser-tools
sysusers2shadow.sh
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File sysusers2shadow.sh of Package sysuser-tools
#!/bin/bash while read LINE do case "$LINE" in \#*|"") ;; g*) eval arr=( $LINE ) ARGUMENTS="${arr[1]}" if [ ! -z "${arr[2]}" -a "${arr[2]}" != "-" ]; then ARGUMENTS="-g ${arr[2]} $ARGUMENTS" fi echo "groupadd -r $ARGUMENTS" /usr/bin/getent group "${arr[1]}" >> /dev/null || /usr/sbin/groupadd -r $ARGUMENTS || exit $? ;; u*) eval arr=( $LINE ) ARGUMENTS="${arr[1]}" if [ ! -z "${arr[2]}" -a "${arr[2]}" != "-" ]; then ARGUMENTS="-u ${arr[2]} $ARGUMENTS" fi if [ ! -z "${arr[4]}" -a "${arr[4]}" != "-" ]; then ARGUMENTS="-d ${arr[4]} $ARGUMENTS" fi /usr/bin/getent group ${arr[1]} >> /dev/null if [ $? -eq 0 ]; then ARGUMENTS="-g ${arr[1]} $ARGUMENTS" else ARGUMENTS="-U $ARGUMENTS" fi echo "useradd -r -s /sbin/nologin -c \"${arr[3]}\" $ARGUMENTS" /usr/bin/getent passwd ${arr[1]} >> /dev/null || /usr/sbin/useradd -r -s /sbin/nologin -c "${arr[3]}" $ARGUMENTS || exit $? ;; m*) eval arr=( $LINE ) echo "usermod -a -G ${arr[2]} ${arr[1]}" /usr/sbin/usermod -a -G ${arr[2]} ${arr[1]} || exit $? ;; r*) echo "range option ignored: \"$LINE\"" ;; *) echo "Syntax Error: \"$LINE\"" exit 1 ;; esac done
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor