config() { NEW="$1" OLD="$(dirname $NEW)/$(basename $NEW .new)" # If there's no config file by that name, mv it over: if [ ! -r $OLD ]; then mv $NEW $OLD elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then # toss the redundant copy rm $NEW fi # Otherwise, we leave the .new copy for the admin to consider... } config etc/sddm.conf.new # Create the daemon account and homedirectory otherwise SDDM won't start: sddmuid=64 sddmgid=64 sddmhome=/var/lib/sddm if ! chroot . getent group sddm > /dev/null; then chroot . groupadd -g $sddmgid sddm res=$? if [ $res -ne 0 ]; then cat < /dev/null; then useradd -c "SDDM Daemon Owner" -d $sddmhome -u $sddmuid \ -g sddm -s /bin/false sddm res=$? if [ $res -ne 0 ]; then cat < /dev/null fi fi mkdir -p $sddmhome chown -R sddm:sddm $sddmhome > /dev/null