Skip to content
Snippets Groups Projects
Commit 86b28a70 authored by Alberto LIVIO BECCARIA's avatar Alberto LIVIO BECCARIA
Browse files

Updated kdm-autologin: fix for multiple # in front of kdmrc lines

parent 4a10cc8d
No related branches found
No related tags found
No related merge requests found
......@@ -22,13 +22,13 @@ stop() {
start() {
echo "KDM AUTOLOGIN FOR ${ESAME_USER}"
sed -i '/AutoLoginEnable/s/.*/AutoLoginEnable=true/' /etc/kde/kdm/kdmrc
sed -i '/AutoLoginAgain/s/.*/AutoLoginAgain=true/' /etc/kde/kdm/kdmrc
sed -i '/#*AutoLoginEnable/s/.*/AutoLoginEnable=true/' /etc/kde/kdm/kdmrc
sed -i '/#*AutoLoginAgain/s/.*/AutoLoginAgain=true/' /etc/kde/kdm/kdmrc
# 1) .* get expanded by the shell if in double quotes...
# 2) $ESAME_USER does not get expanded if in single quotes...
# 3) We want the former as is, and the latter expanded.
# So, one solution is the following:
SEDCMD="/AutoLoginUser/s/"'.*'"/AutoLoginUser=$ESAME_USER/"
SEDCMD="/#*AutoLoginUser/s/"'.*'"/AutoLoginUser=$ESAME_USER/"
sed -i "$SEDCMD" /etc/kde/kdm/kdmrc
#sleep 5
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment