2 # 2011 markus schnalke <meillo@marmaro.de>
4 # replacement for install-mh(1)
5 # set up mmh for the user
9 # Todo: use chmod or set umask for created files?
10 # Todo: install signal handlers and tell how to abort
13 # the following constants must match the values in config/config.c
22 while [ $# -ge 1 ] ; do
25 # check if mmh is set up
26 # Note: The mail storage dir gets silently created if
27 # everything else is properly set up.
28 folder -create >/dev/null 2>&1
32 echo "mmh has no own version number, thus this instead:"
37 echo "Usage: $0 -- set up mmh for you" >&2
38 echo " $0 -c -- check if mmh is set up for you" >&2
46 Welcome to mmh, meillo's MH version
47 ===================================
48 This program does only one small, but important task: it sets up mmh for your
49 user account. Afterwards you can access the functions of mmh by using any of
50 the specialized tools from the mmh toolchest. The man page mmh(1) lists them.
51 Consult the man pages of the individual programs for further documentation.
53 But now, let's set up mmh for you ...
64 echo "Path: $mailstore" >"$profile"
76 mmhdir="${MMH:=$mmhdir}"
79 if [ -d "$mmhdir" ] ; then
80 echo "--> Using existing mmh directory $mmhdir"
82 mkdir "$mmhdir" && echo "--> Created mmh directory $mmhdir"
91 profile="${MMHP:=$profile}" # relative to $mmhpath
92 if [ -f "$profile" ] ; then
94 echo "You already have an mmh profile."
95 printf "Do you want to edit the file now? [Y/n] "
100 ${VISUAL:-${EDITOR:-vi}} "$profile"
117 echo "Mmh needs a mail storage."
118 cd # relative to HOME
119 if [ -d "$mailstore" ] ; then
120 echo "The suggested directory `pwd`/$mailstore already exists."
121 printf "Do you want to use it for mmh? [Y/n] "
126 echo "--> Using existing directory $mailstore"
132 printf "Where do you want it to be located? [`pwd`/Mail] "
134 if [ -z "$answ" ] ; then
137 mkdir "$answ" && echo "--> Created $answ"