X-Git-Url: https://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=etc%2Fgrml%2Ffai%2Fconfig%2Fscripts%2FGRMLBASE%2F21-usersetup;h=bc09c1f3692fd41f9163d25d451ea866b0108da4;hp=321451162ca62fd7e3be9accd5b3094d4535a606;hb=HEAD;hpb=130429e20fb319f3ec6a457f3219b7e52216b542 diff --git a/etc/grml/fai/config/scripts/GRMLBASE/21-usersetup b/etc/grml/fai/config/scripts/GRMLBASE/21-usersetup index 3214511..50d43e6 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/21-usersetup +++ b/etc/grml/fai/config/scripts/GRMLBASE/21-usersetup @@ -1,32 +1,18 @@ -#!/bin/sh -# Filename: /etc/grml/fai/config/scripts/GRMLBASE/21-usersetup +#!/bin/bash +# Filename: ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/21-usersetup # Purpose: adjust user setup of the live-system # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2 or any later version. -# Latest change: Thu Nov 15 09:42:42 CET 2007 [mika] ################################################################################ set -u set -e - -USERNAME='' -[ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf -[ -r /etc/grml/grml-live.local ] && . /etc/grml/grml-live.local -[ -n "$USERNAME" ] || USERNAME=grml +. "$GRML_LIVE_CONFIG" if grep -q "$USERNAME:x:1000" $target/etc/group ; then echo "group $USERNAME exists already, skipping" else - if grep -q 'gsmsms:x:1000' $target/etc/group ; then - echo 'Bug #353967 detected, fixing GUID = 1000 setup for you' - $ROOTCMD delgroup gsmsms || /bin/true - $ROOTCMD deluser gsmsms || /bin/true - $ROOTCMD addgroup --system gsmsms || /bin/true - $ROOTCMD adduser --system --ingroup gsmsms \ - --no-create-home --home /var/spool/sms gsmsms || /bin/true - $ROOTCMD adduser gsmsms dialout || /bin/true - fi $ROOTCMD addgroup --gid 1000 $USERNAME fi @@ -40,7 +26,7 @@ fi add_user_to_group() { [ -n "$1" ] || return 1 if grep -q $1 $target/etc/group ; then - grep "$1:x:.*$USERNAME" $target/etc/group || $ROOTCMD addgroup $USERNAME $1 + grep "$1:x:.*$USERNAME" $target/etc/group || $ROOTCMD adduser $USERNAME $1 fi } @@ -49,10 +35,13 @@ add_user_to_group camera add_user_to_group cdrom add_user_to_group dialout add_user_to_group dip +add_user_to_group disk add_user_to_group fax add_user_to_group floppy add_user_to_group fuse add_user_to_group games +add_user_to_group input +add_user_to_group netdev add_user_to_group nvram add_user_to_group plugdev add_user_to_group scanner @@ -61,6 +50,7 @@ add_user_to_group tape add_user_to_group tty add_user_to_group usb add_user_to_group users +add_user_to_group vboxsf add_user_to_group video add_user_to_group vlock add_user_to_group voice @@ -68,10 +58,10 @@ add_user_to_group voice sed -i 's/^root::/root:*:/' $target/etc/shadow sed -i "s/^$USERNAME:!:/$USERNAME:*:/" $target/etc/shadow -if [ -r $target/bin/zsh ] ; then +if $ROOTCMD [ -r /bin/zsh ] ; then $ROOTCMD chsh -s /bin/zsh root $ROOTCMD chsh -s /bin/zsh $USERNAME fi ## END OF FILE ################################################################# -# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3 +# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2