From d63731ebac191e9815724dc9ca88ec4fa3083649 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Tue, 6 Mar 2018 17:07:09 -0500 Subject: [PATCH] preserve distro profile and bashrc --- init.sh => cloud-init.sh | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) rename init.sh => cloud-init.sh (65%) diff --git a/init.sh b/cloud-init.sh similarity index 65% rename from init.sh rename to cloud-init.sh index 7196329..fe2f286 100644 --- a/init.sh +++ b/cloud-init.sh @@ -4,8 +4,8 @@ ##cloud-config #runcmd: -# - curl -fsSL https://raw.githubusercontent.com/sneak/hacks/master/init.sh | bash - +# - curl -fsSL https://raw.githubusercontent.com/sneak/hacks/master/cloud-init.sh | bash + #exec 1 2>&1 | tee -a ${LOG_FILE} export DEBIAN_FRONTEND=noninteractive @@ -21,21 +21,28 @@ fi # run the rest as sneak: sudo -H -u sneak bash < authorized_keys fi -if [[ ! -d /home/sneak/hacks ]]; then - cd /home/sneak +if [[ ! -d ~/hacks ]]; then + cd ~ git clone https://github.com/sneak/hacks.git fi -rsync -avP /home/sneak/hacks/homedir.skel/ /home/sneak/ +mkdir -p ~/.local/bashrc.d +mkdir -p ~/.local/profile.d +mv ~/.profile ~/.local/profile.d/999.distro.profile.sh +mv ~/.bashrc ~/.local/bashrc.d/999.distro.bashrc.sh + +rsync -avP /home/sneak/hacks/homedir.skel/ /home/sneak/ EOF