dotfiles

config files and scripts at HOME.
git clone git://git.ricketyspace.net/dotfiles.git
Log | Files | Refs

commit c9d1ca08d9e94e7734259350562c096f6437be95
parent 2361e56091a2add2567ddd3be0c0c25f0ae5154c
Author: rsiddharth <s@ricketyspace.net>
Date:   Thu, 10 Aug 2017 02:56:38 +0000

.bin: Add certbot-ws

Diffstat:
.bin/certbot-ws | 47+++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+), 0 deletions(-)

diff --git a/.bin/certbot-ws b/.bin/certbot-ws @@ -0,0 +1,47 @@ +#!/bin/sh +# +# Copyright © 2017 rsiddharth <s@ricketyspace.net> +# License: GNU General Public License version 3 or higher. +# +# systemd-nspawn container for messing with certbot. +# + +CONTAINER_DIR=$HOME'/.containers' +CONTAINER_NAME='certbot-ws' +CONTAINER=$CONTAINER_DIR'/'$CONTAINER_NAME +SCRIPT=`which "$0"` + +CERTBOT_DIR=$HOME'/v/git/others/certbot' + +TERMINFO_SRC='/usr/share/terminfo/r/rxvt-256color:' +TERMINFO_BIND=$TERMINFO_SRC'/root/.terminfo/r/rxvt-256color' + +if [ "$1" = "bootstrap" ]; then + echo 'debootstraping' + mkdir -p $CONTAINER_DIR + [ ! -d $CONTAINER ] && + sudo debootstrap --arch=amd64 testing $CONTAINER + echo 'starting container' + sudo systemd-nspawn -D $CONTAINER \ + --bind-ro=$SCRIPT:/root/$SCRIPT \ + /root/$SCRIPT install +elif [ "$1" = "install" ]; then + echo 'installing paraphernalia in container' + F='/etc/apt/sources.list' && \ + [ `grep deb-src $F | wc -l` = '0' ] && \ + echo 'deb-src http://deb.debian.org/debian testing main' >> $F + apt-get update -y + apt-get install -y build-essential python-dev curl screen + apt-get upgrade -y +elif [ "$1" = "start-container" ]; then + echo 'starting container' + sudo systemd-nspawn --setenv=DISPLAY=:0.0 \ + -D $CONTAINER \ + --bind-ro=$TERMINFO_BIND \ + --bind-ro=$SCRIPT:/root/$SCRIPT \ + --bind=$CERTBOT_DIR:/root/certbot +else + echo 'Dunno what to do' + exit 1 +fi +