source: lliurex-base-files/trunk/fuentes/install/usr/sbin/update-base-groups @ 121

Last change on this file since 121 was 121, checked in by hectorgh, 5 years ago

adding project files

  • Property svn:executable set to *
File size: 548 bytes
Line 
1#!/bin/sh
2
3set -e
4
5# system groups
6GROUP_DIR="/usr/share/lliurex-base-files/groups/"
7if [ -d "$GROUP_DIR" ] ; then
8        find "$GROUP_DIR" -xtype f -exec cat {} \; |while read line ; do
9                if [ "$line" ] ; then
10                        line="${line%:}"
11                        lNAME="${line%%:*}"
12                        lGID="${line##*:}"
13                fi
14
15                rc=0
16                cat /etc/group | grep -q $lNAME || rc=1
17                if [ $rc -eq 0 ]; then
18
19                        groupmod -g $lGID $lNAME || true
20
21                else
22
23                        addgroup --system --quiet --gid "$lGID" "$lNAME" || true
24
25                fi
26
27               
28
29        done
30        # TODO: think the way to update network (ldap) groups also ...
31fi
32
33exit 0
Note: See TracBrowser for help on using the repository browser.