2 # shellcheck disable=SC1091
28 install_root_profile() {
29 groupinstall -o root:wheel -m 644 "root.profile.$(uname)" /root/.profile
33 motd_content="Welcome on $(nodename)"
36 printf %s\\n "$motd_content" >motd
37 install -o root:wheel -m 644 motd /etc/motd
40 printf %s\\n "$motd_content" >motd.template
41 install -o root:wheel -m 644 motd.template /etc && service motd restart
46 install_ssh_authorized_keys() {
47 for file in "$(nodedir)"/ssh/authorized_keys_*; do
49 error "missing authorized_keys file in $(nodedir)/ssh/"
53 id -u "$user" >/dev/null || return 1
54 home=$(getent passwd "$user" | awk -F: '{ print $6 }')
58 install -m 600 -o "$(id -u "$user"):$(id -g "$user")" "$file" "$sshdir/authorized_keys"
59 chown -R "$(id -u "$user"):$(id -g "$user")" "$sshdir"