Autologin fix (attempt 1)

This commit is contained in:
xdrm-brackets 2017-01-22 11:04:56 +01:00
parent 33afd08122
commit 226985f061
1 changed files with 14 additions and 14 deletions

View File

@ -235,28 +235,28 @@ step8(){
# (1) Copy default login systemd script # # (1) Copy default login systemd script #
echo " (.) Copy default getty systemd script"; #echo " (.) Copy default getty systemd script";
sudo cp /mnt/lib/systemd/system/getty@.service /mnt/etc/systemd/system/autologin@.service; #sudo cp /mnt/lib/systemd/system/getty@.service /mnt/etc/systemd/system/autologin@.service;
sudo chmod 755 /mnt/etc/systemd/system/autologin@.service; #sudo chmod 755 /mnt/etc/systemd/system/autologin@.service;
# (2) Create link in order to be handled # # (2) Create link in order to be handled #
echo " (.) Create script link to be handled"; echo " (.) Create script link to be handled";
test -e /mnt/etc/systemd/system/getty.target.wants/getty@tty1.service && sudo rm /mnt/etc/systemd/system/getty.target.wants/getty@tty1.service; #test -e /mnt/etc/systemd/system/getty.target.wants/getty@tty1.service && sudo rm /mnt/etc/systemd/system/getty.target.wants/getty@tty1.service;
sudo ln -s /mnt/etc/systemd/system/autologin@.service /mnt/etc/systemd/system/getty.target.wants/getty@tty1.service; sudo ln -s /mnt/etc/systemd/system/autologin@.service /mnt/etc/systemd/system/getty.target.wants/getty@tty1.service;
# (3) Update autologin script # # (3) Update autologin script #
echo " (.) Update script to autologin as 'sats-user'"; #echo " (.) Update script to autologin as 'sats-user'";
sudo cat /mnt/etc/systemd/system/autologin@.service | \ #sudo cat /mnt/etc/systemd/system/autologin@.service | \
sed 's/^ExecStart=-\/sbin\/agetty --noclear/ExecStart=-\/sbin\/agetty --autologin sats-user/' | \ # sed 's/^ExecStart=-\/sbin\/agetty --noclear/ExecStart=-\/sbin\/agetty --autologin sats-user/' | \
sed 's/^Restart=.\+$/Restart=no/' | \ # sed 's/^Restart=.\+$/Restart=no/' | \
sed 's/^Restart=.\+$/Restart=no/' | \ # sed 's/^Restart=.\+$/Restart=no/' | \
sed 's/^\[Service\]$/\[Service\]\nAlias=getty.target.wants\/getty@tty1.service/' | \ # sed 's/^\[Service\]$/\[Service\]\nAlias=getty.target.wants\/getty@tty1.service/' | \
tee tmp/autologin > /dev/null; # tee tmp/autologin > /dev/null;
# (4) Updating file from tmp update # # (4) Updating file from tmp update #
echo " (.) Copying temporary update to real file"; #echo " (.) Copying temporary update to real file";
cat tmp/autologin | sudo tee /mnt/etc/systemd/system/autologin@.service > /dev/null; #cat tmp/autologin | sudo tee /mnt/etc/systemd/system/autologin@.service > /dev/null;
rm tmp/autologin; #rm tmp/autologin;
echo "<<< done"; echo "<<< done";