rohrpost

A commandline mail client to change the world as we see it.
git clone git://r-36.net/rohrpost
Log | Files | Refs | LICENSE

commit 11f3731923ecaf1a704950bca0336acee7204916
parent 4f92b3d8c7fe58689e2fbd91fee3952a45a9c4bc
Author: Christoph Lohmann <20h@r-36.net>
Date:   Thu, 21 Mar 2013 19:08:29 +0100

Adding a migrate script between different configurations.

Diffstat:
bin/rpmigrate | 27+++++++++++++++++++++++++++
1 file changed, 27 insertions(+), 0 deletions(-)

diff --git a/bin/rpmigrate b/bin/rpmigrate @@ -0,0 +1,27 @@ +#!/bin/sh + +if [ $# -lt 3 ]; +then + printf "usage: %s cfgfrom cfgto folder\n" "$(basename $0)" >&2 + exit 1 +fi + +cfgfrom="$1" +cfgto="$2" +folder="$3" + +rpfold -qc "$cfgfrom" -l "$3" +if [ $? -gt 0 ]; +then + printf "'%s' does not exist in '%s'\n" "$folder" "$cfgfrom" >&2 + exit 1 +fi + +rpfold -qc "$cfgto" -l "$3" +[ $? -gt 0 ] && rpfold -n "$3" + +for msg in $(rpids -c "$cfgfrom" :); +do + rpview -c "$cfgfrom" "$msg" | rpadd -c "$cfgto" -q; +done +