summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-06-24 14:45:52 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-06-24 14:45:52 +0200
commit1a5512cc56a0172ab0738a482059af33e06fd08f (patch)
treeeed4872123cfa7202d9c731f542be96dfa782ac8
parentc4d5c92946e14527c96ed6740f24b48e96b6f418 (diff)
downloaditzks-systems-1a5512cc56a0172ab0738a482059af33e06fd08f.tar.gz
itzks-systems-1a5512cc56a0172ab0738a482059af33e06fd08f.tar.bz2
itzks-systems-1a5512cc56a0172ab0738a482059af33e06fd08f.zip
itzks-systems-tablet: Add LDAP-derived local user to system groups on initial login.
-rw-r--r--debian/itzks-systems-roamingworkstation.install2
-rw-r--r--debian/itzks-systems-tablet.install3
-rwxr-xr-xetc/mklocaluser.d/60-itzks-systems-tablet_add-to-local-groups18
3 files changed, 21 insertions, 2 deletions
diff --git a/debian/itzks-systems-roamingworkstation.install b/debian/itzks-systems-roamingworkstation.install
index cfee6f4..5bdb44b 100644
--- a/debian/itzks-systems-roamingworkstation.install
+++ b/debian/itzks-systems-roamingworkstation.install
@@ -1,4 +1,4 @@
-etc/mklocaluser.d/
+etc/mklocaluser.d/60-itzks-systems-roamingworkstation_*
etc/skel/.pki
etc/skel/Desktop/libreoffice-impress.desktop
etc/skel/Desktop/pwdchange.desktop
diff --git a/debian/itzks-systems-tablet.install b/debian/itzks-systems-tablet.install
index 0424bae..a0f04a1 100644
--- a/debian/itzks-systems-tablet.install
+++ b/debian/itzks-systems-tablet.install
@@ -1,4 +1,5 @@
-etc/mklocaluser.d/
+etc/mklocaluser.d/60-itzks-systems-roamingworkstation_*
+etc/mklocaluser.d/60-itzks-systems-tablet_*
etc/skel/.pki
etc/skel/.mozilla
etc/skel/.debian-edu/welcome-page-shown
diff --git a/etc/mklocaluser.d/60-itzks-systems-tablet_add-to-local-groups b/etc/mklocaluser.d/60-itzks-systems-tablet_add-to-local-groups
new file mode 100755
index 0000000..3b59b2d
--- /dev/null
+++ b/etc/mklocaluser.d/60-itzks-systems-tablet_add-to-local-groups
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+groups="audio cdrom dip plugdev video netdev scanner lpadmin"
+
+# add additional user account
+if [ -n "$USER" ]; then
+
+ if ! getent passwd $USER ; then
+ adduser --disabled-login --gecos "$USER user" $USER
+ usermod -p "$USERPW" $USER
+ userdir=$(getent passwd "$USER" | cut -d: -f6 )
+
+ for g in $groups; do
+ adduser $USER $g
+ done
+ fi
+
+fi