summaryrefslogtreecommitdiff
path: root/test-vm/antigen.sh
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2015-07-19 15:11:55 +0300
committerDominik Ritter <dritter03@googlemail.com>2015-07-19 15:11:55 +0300
commitb82e19f07330d4c7fddfb3b6264268e619585326 (patch)
treecf7f040a3a2a7c0dadb6c6a4686a9572af809c54 /test-vm/antigen.sh
parent10c5b28859d372f480c1352d4b7a74672e77b430 (diff)
parent83584894703039a4337b1f7d7b969992ea4cb9c9 (diff)
Merge branch 'master' into dritter/minimize_dependencies
Diffstat (limited to 'test-vm/antigen.sh')
-rw-r--r--test-vm/antigen.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/test-vm/antigen.sh b/test-vm/antigen.sh
new file mode 100644
index 00000000..0f44c6ca
--- /dev/null
+++ b/test-vm/antigen.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/zsh
+# We need to run this script in ZSH, so that switching user works!
+NEW_USER=vagrant-antigen
+# Create User
+PASSWORD='$6$OgLg9v2Z$Db38Jr9inZG7y8BzL8kqFK23fF5jZ7FU1oiIBLFjNYR9XVX03fwQayMgA6Rm1rzLbXaf.gkZaTWhB9pv5XLq11'
+useradd -p $PASSWORD -g vagrant -s $(which zsh) -m $NEW_USER
+echo "$NEW_USER ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/$NEW_USER
+chmod 440 /etc/sudoers.d/$NEW_USER
+
+(
+ # Change User (See http://unix.stackexchange.com/questions/86778/why-cant-we-execute-a-list-of-commands-as-different-user-without-sudo)
+ USERNAME=$NEW_USER
+ #UID=$(id -u $NEW_USER)
+ #EUID=$(id -u $NEW_USER)
+ HOME=/home/$NEW_USER
+
+ echo "
+source ~/antigen/antigen.zsh\n
+antigen theme /vagrant_data powerlevel9k --no-local-clone\n
+antigen apply
+" > ~/.zshrc
+
+ # install antigen
+ mkdir ~/antigen
+ curl -qL https://raw.githubusercontent.com/zsh-users/antigen/master/antigen.zsh > ~/antigen/antigen.zsh
+ source ~/antigen/antigen.zsh
+)