diskimage-builder/diskimage_builder/elements/zypper/install.d/01-login-defs
Colleen Murphy 4fb5a57b8a Fix login.defs config for tumbleweed
On openSUSE Tumbleweed, the login.defs config file was moved under
/usr[1]. This change allows the login.defs config change to work for
both old and new locations.

[1] https://build.opensuse.org/request/show/736424

Change-Id: Ia5eff5e7b0709836278361b1b8daa788619eff75
2019-12-02 16:21:45 -08:00

15 lines
279 B
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
if [[ ${DIB_RELEASE} == tumbleweed ]] ; then
login_defs=/usr/etc/login.defs
else
login_defs=/etc/login.defs
fi
sed -i -e "s,^USERGROUPS_ENAB.*$,USERGROUPS_ENAB yes," $login_defs