1
0
mirror of https://github.com/rancher/os.git synced 2025-09-07 01:31:06 +00:00

Refactor build scripts

This commit is contained in:
Darren Shepherd
2016-05-06 10:12:09 -07:00
parent acc2ee297a
commit ec410addb9
103 changed files with 1310 additions and 632 deletions

View File

@@ -0,0 +1,20 @@
#!/bin/bash
USERNAME=$1
HOME_DIR=$(grep ^$USERNAME /etc/passwd | cut -f6 -d:)
if [ ! -d $HOME_DIR/.ssh ]; then
mkdir -p $HOME_DIR/.ssh
chmod 0700 $HOME_DIR/.ssh
fi
if [ ! -e $HOME_DIR/.ssh/authorized_keys ]; then
touch $HOME_DIR/.ssh/authorized_keys
chmod 0600 $HOME_DIR/.ssh/authorized_keys
fi
if ! grep -q "$2" $HOME_DIR/.ssh/authorized_keys; then
echo "$2" >> $HOME_DIR/.ssh/authorized_keys
fi
chown -R $USERNAME $HOME_DIR/.ssh