dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit e4025935adc99fcc340edfead9a78cc594eb9d23
parent a6081809f889144dba9ca546bc25342d1afd7457
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Thu,  7 May 2020 15:16:46 +0200

Add vpn script and improve parsing of text/calendar

Diffstat:
A.local/bin/auvpn | 13+++++++++++++
M.local/bin/plumb | 4++--
2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/.local/bin/auvpn b/.local/bin/auvpn @@ -0,0 +1,13 @@ +#!/bin/sh +set -e + +if [ "$(id -u)" = 0 ]; then + printf '%s: error: dont run with root' "${0##*/}" + exit 1 +fi + +pass="$(pass Uni/mit.au.dk-217756)" + +doas sh -c "printf '%s' '$pass' | \ + openconnect -u au217756@uni.au.dk --passwd-on-stdin \ + https://remote.au.dk/st" diff --git a/.local/bin/plumb b/.local/bin/plumb @@ -79,8 +79,8 @@ handle_calendar_invite() { endtime="$(grep -E "DTEND.*" "$1" | sed 's/.*://' | \ annotate_date_string )" tzone="$(grep -E "DTEND.*TZID" "$1" | sed 's/.*TZID=\(.*\):.*/\1/' )" - summary="$(grep -E "SUMMARY.*:" "$1" | sed 's/.*: *//' )" - location="$(grep -E "LOCATION.*:" "$1" | sed 's/.*: *//' )" + summary="$(grep -E "SUMMARY[;:].*:" "$1" | sed 's/[^:]*: *//' )" + location="$(grep -E "LOCATION[;:].*:" "$1" | sed 's/[^:]*: *//' )" printf 'start time: %s\n' "$starttime" printf 'end time: %s\n' "$endtime"