From 433c947332f8ffa16d478c38e8b95f2d6e56292d Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 22 Jan 2017 11:12:10 +0100 Subject: [PATCH] Added link forced --- clone/clone | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/clone/clone b/clone/clone index 15a763e..33aeb77 100755 --- a/clone/clone +++ b/clone/clone @@ -117,19 +117,19 @@ step4(){ step5(){ echo "\n>>> [5] Updating users"; - echo " (.) Adding user sats-user"; + echo " (.) Adding user sats-user"; # shadow - echo " /etc/shadow"; + echo " /etc/shadow"; ## TODO: Manage default password ## echo "sats-user:$6$k0vFWRoG$bEBdFcFBWw2fLEA.5LsVKOtLWdWSkZMnEikqOG4jHCneRrWEBnEt6.ROe60ggdA7DbdU.l2ZO35WFvi3q6Ays/:17185:0:999999:7::" | sudo tee -a /mnt/etc/shadow > /dev/null; echo "sats-user:$6$k0vFWRoG$bEBdFcFBWw2fLEA.5LsVKOtLWdWSkZMnEikqOG4jHCneRrWEBnEt6.ROe60ggdA7DbdU.l2ZO35WFvi3q6Ays/:17185:0:999999:7::" | sudo tee -a /mnt/etc/shadow- > /dev/null; # passwd - echo " /etc/passwd"; + echo " /etc/passwd"; echo "sats-user:x:666:666:sats-user,,,:/home/sats-user:/bin/sh" | sudo tee -a /mnt/etc/passwd > /dev/null; echo "sats-user:x:666:666:sats-user,,,:/home/sats-user:/bin/sh" | sudo tee -a /mnt/etc/passwd- > /dev/null; - echo " (.) Removing pi's login password"; + echo " (.) Removing pi's login password"; # create temp file without pi's password #sudo cat /mnt/etc/shadow | sed 's/pi:[^:]\+:/pi:*:/' | sudo tee /mnt/etc/shadow.tmp > /dev/null; # write original files @@ -154,15 +154,15 @@ step5(){ step6(){ echo "\n>>> [6] Updating groups"; - echo " (.) Adding group ssh-key"; + echo " (.) Adding group ssh-key"; # group - echo " /etc/group"; + echo " /etc/group"; echo "ssh-key:x:555:pi,sats-user" | sudo tee -a /mnt/etc/group > /dev/null; echo "ssh-key:x:555:pi,sats-user" | sudo tee -a /mnt/etc/group- > /dev/null; - echo " (.) Adding group sats-user"; + echo " (.) Adding group sats-user"; # group - echo " /etc/group"; + echo " /etc/group"; echo "sats-user:x:666:sats-user" | sudo tee -a /mnt/etc/group > /dev/null; echo "sats-user:x:666:sats-user" | sudo tee -a /mnt/etc/group- > /dev/null; @@ -242,7 +242,7 @@ step8(){ # (2) Create link in order 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; - sudo ln -s /mnt/etc/systemd/system/autologin@.service /mnt/etc/systemd/system/getty.target.wants/getty@tty1.service; + sudo ln -fs /mnt/etc/systemd/system/autologin@.service /mnt/etc/systemd/system/getty.target.wants/getty@tty1.service; # (3) Update autologin script # #echo " (.) Update script to autologin as 'sats-user'";