Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of https://github.com/mkocher/chef_deploy

  • Loading branch information...
commit 992a5786dfae70390eb4f2ee0e4c03a52ba6f953 2 parents 44d7bfa + 2a076cc
Matthew Kocher authored
Showing with 14 additions and 1 deletion.
  1. +14 −1 bootstrap.sh
15 bootstrap.sh
View
@@ -4,6 +4,17 @@ export app_user="mkocher"
# perl -e 'print crypt("password", "salt"),"\n"'
getent passwd $app_user >/dev/null 2>&1 || useradd $app_user -p sa3tHJ3/KuYvI
+# copy root's authorized keys to app_user
+mkdir -p /home/$app_user/.ssh
+touch /home/$app_user/.ssh/authorized_keys
+chmod 700 /home/$app_user/.ssh
+chmod 600 /home/$app_user/.ssh/authorized_keys
+chown -R $app_user /home/$app_user/.ssh
+
+authorized_keys_string=`cat /root/.ssh/authorized_keys`
+grep -sq "$authorized_keys_string" /home/$app_user/.ssh/authorized_keys || cat /root/.ssh/authorized_keys >> /home/$app_user/.ssh/authorized_keys
+
+
## enable ssh password auth
perl -p -i -e 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
/etc/init.d/sshd reload
@@ -24,7 +35,9 @@ grep "$sudo_string" /etc/sudoers || echo "$sudo_string" >> /etc/sudoers
cat <<'BOOTSTRAP_AS_USER' > /home/$app_user/bootstrap_as_user.sh
set -e
-bash < <( curl --insecure https://rvm.beginrescueend.com/install/rvm )
+mkdir -p /home/$app_user/rvm/src
+curl -Lsf http://github.com/wayneeseguin/rvm/tarball/156d0b42feba4922ad04 | tar xvz -C/home/$app_user/rvm/src --strip 1
+cd "/home/$app_user/rvm/src" && ./install
rvm_include_string='[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"'
grep "$rvm_include_string" ~/.bashrc || echo "$rvm_include_string" >> ~/.bashrc
Please sign in to comment.
Something went wrong with that request. Please try again.