configure and unconfigure liveuser for autologin in posttran script [release 2.9.0-2mamba;Fri Feb 20 2015]

This commit is contained in:
Silvan Calarco 2024-01-06 06:24:36 +01:00
parent 70fbf88eba
commit 58af4257ea

View File

@ -3,7 +3,7 @@
%define lpadmin_gid 65032
Name: livecd-tools
Version: 2.9.0
Release: 1mamba
Release: 2mamba
Summary: Live cd environment and utilities
Group: System/Tools
Vendor: openmamba
@ -100,16 +100,55 @@ fi
%postun
if [ $1 -eq 0 ]; then
userdel liveuser
userdel -r -f liveuser
# Unconfigure KDM for autologin
if [ -e /opt/kde/share/config/kdm/kdmrc -a \
"`grep AutoLoginUser=liveuser /opt/kde/share/config/kdm/kdmrc`" ]; then
sed -i 's|^AutoLoginUser=liveuser|#AutoLoginUser=|' \
/opt/kde/share/config/kdm/kdmrc
sed -i 's|^AutoLoginEnable=true|#AutoLoginEnable=true|' \
/opt/kde/share/config/kdm/kdmrc
fi
# Unconfigure LXDM for autologin
[ -e /etc/lxdm/lxdm.conf ] && sed -i "s|^autologin=liveuser|# autologin=|" \
/etc/lxdm/lxdm.conf
# Unconfigure GDM for autologin
if [ -e /etc/gdm/custom.conf -a -e /etc/gdm/custom.conf.livesave ]; then
mv /etc/gdm/custom.conf.livesave /etc/gdm/custom.conf
fi
fi
#%if "%{stage1}" != "1"
# sed -i /eject_cd.sh/d $MOUNTPOINT/etc/init.d/halt
# sed -i /eject_cd.sh/d $MOUNTPOINT/etc/init.d/reboot
#%endif
fi
:
%posttrans
gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null
if [ $1 -eq 1 ]; then
# Configure KDM for autologin
if [ -e /opt/kde/share/config/kdm/kdmrc ]; then
sed -i 's|[#]*AutoLoginEnable=.*|AutoLoginEnable=true|' \
/opt/kde/share/config/kdm/kdmrc
sed -i 's|[#]*AutoReLogin=.*|AutoReLogin=true|' \
/opt/kde/share/config/kdm/kdmrc
sed -i 's|[#]*AutoLoginUser=.*|AutoLoginUser=liveuser|' \
/opt/kde/share/config/kdm/kdmrc
fi
# Configure LXDM for autologin
[ -e /etc/lxdm/lxdm.conf ] && sed -i "s|# autologin.*|autologin=liveuser|" \
/etc/lxdm/lxdm.conf
# Configure GDM for autologin
if [ -e /etc/gdm/custom.conf ]; then
mv /etc/gdm/custom.conf /etc/gdm/custom.conf.livesave
cat > /etc/gdm/custom.conf << _EOF
[daemon]
AutomaticLoginEnable=true
AutomaticLogin=liveuser
_EOF
fi
fi
:
%files -f installer.lang
%defattr(-,root,root)
@ -141,6 +180,9 @@ gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null
%attr(-,liveuser,users) /home/liveuser/.kde4/share/config/*
%changelog
* Fri Feb 20 2015 Silvan Calarco <silvan.calarco@mambasoft.it> 2.9.0-2mamba
- configure and unconfigure liveuser for autologin in posttran script
* Thu Feb 19 2015 Silvan Calarco <silvan.calarco@mambasoft.it> 2.9.0-1mamba
- update to 2.9.0