From 06e8f1e3855c88c1fa85b646e0f334a8f06f9039 Mon Sep 17 00:00:00 2001 From: Sonny Date: Sat, 17 Jun 2017 20:40:54 +0200 Subject: [PATCH] Dotfiles & curl installation --- initialize_script | 17 ++--------------- scripts/create_container | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/initialize_script b/initialize_script index 9bc5972..4fa2311 100755 --- a/initialize_script +++ b/initialize_script @@ -7,11 +7,10 @@ function get_path { function user_config { - if [ 'dpkg -l curl' == 1 ]; then + CURL='dpkg-query -l | grep curl | wc -l' + if [ "$CURL" > 0 ]; then echo 'Curl not installed, installing....' apt-get install -y curl - #echo 'Exiting...' - #exit 1 fi curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ @@ -27,17 +26,5 @@ function user_config { } -function powerline_fonts { - git clone https://github.com/powerline/fonts.git $HOME/.fonts - $HOME/.fonts/install.sh -} - user_config echo 'Dont forget to run :PlugInstall inside vim!' - -echo -n 'Extra fonts? [y/n]' -read FONTS - -if [ "$FONTS" == "y" ] ;then - powerline_fonts -fi diff --git a/scripts/create_container b/scripts/create_container index a175d22..40090a0 100755 --- a/scripts/create_container +++ b/scripts/create_container @@ -33,6 +33,8 @@ function create_container { echo "Starting container first time, enter root pass" systemd-nspawn -D $CONTAINER_PATH passwd + + dotfiles $CONTAINER_PATH } function add_ssh { @@ -45,4 +47,16 @@ function add_ssh { sed -i 's/^#PermitRootLogin .*/PermitRootLogin yes/' $1/etc/ssh/sshd_config } +function dotfiles { + echo -n "Add dotfiles? [y/n]: " + read DOTFILES + + if [ "$DOTFILES" == "y" ] ;then + systemd-nspawn -D $1 git clone https://www.github.com/SonnyBA/dotfiles.git $1/root/dotfiles + systemd-nspawn -D $1 $1/root/dotfiles/initialize_script + elif [ -z "$SSH_SERVER" ] ;then + echo "Not cloning anything" + fi +} + create_container