Commit 63d48e7f authored by Marco Marinello's avatar Marco Marinello

Change root password support

Signed-off-by: Marco Marinello's avatarMarco Marinello <mmarinello@sezf.it>
parent 78221e4d
......@@ -18,15 +18,20 @@ fi
if [ -e /root/join ]; then
# Stop the display manager to output on tty7
systemctl stop lightdm
# Change root password
if [ -e /root/new_root_pw ] ; then
echo "root:$(cat /root/new_root_pw)" | chpasswd -e
fi
# Following dhclient was necessary inside a virtual(box) environment. Not sure if needed anymore. In case it can be removed or commented.
dhclient $myNic
screen -d -m -S XY
screen -S XY -X stuff "exec 2>&1 > /dev/tty7\n"
screen -S XY -X stuff "fuss-client -av $clusterJoin && rm /root/join ; reboot\n"
else
rm /etc/rc.local
rm /root/clientScript
rm -fr /root/.ssh
rm /root/cluster
rm -f /etc/rc.local
rm -f /root/clientScript
rm -f /root/cluster
rm -f /root/new_root_pw
fi
......@@ -94,6 +94,9 @@ if [ "$joinVar" == "join" ];then
cp /home/partimag/clientScripts/rc.local /mnt/etc/
chmod 770 /mnt/etc/rc.local
cp /home/partimag/clientScripts/clientScript /mnt/root/
if [ -e /home/partimag/clientScripts/new_root_pw ] ; then
cp /home/partimag/clientScripts/new_root_pw /mnt/root/
fi
chmod 770 /mnt/root/clientScript
touch /mnt/root/reboot
fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment