create_schleuder3_list.sh: make script usable for normal users, not only for root.
This commit is contained in:
parent
f09424768b
commit
6d4d2ccab0
@ -54,9 +54,9 @@ usage() {
|
|||||||
|
|
||||||
\033[1mExample:\033[m
|
\033[1mExample:\033[m
|
||||||
|
|
||||||
Create List 'testlist@il-schleuder.de':
|
Create List 'testlist@cryptolists.so36.net':
|
||||||
|
|
||||||
\033[1m$(basename $0) -n testlist -d il-schleuder.de\033[m
|
\033[1m$(basename $0) -n testlist -d cryptolists.so36.net\033[m
|
||||||
|
|
||||||
|
|
||||||
"
|
"
|
||||||
@ -225,6 +225,7 @@ fi
|
|||||||
LOGGING=false
|
LOGGING=false
|
||||||
BATCH_MODE=false
|
BATCH_MODE=false
|
||||||
DEFAULT_SCHLEUDER_HOME="/var/lib/schleuder"
|
DEFAULT_SCHLEUDER_HOME="/var/lib/schleuder"
|
||||||
|
#DEFAULT_LIST_DOMAIN="cryptolists.so36.net"
|
||||||
DEFAULT_LIST_DOMAIN="il-schleuder.de"
|
DEFAULT_LIST_DOMAIN="il-schleuder.de"
|
||||||
DEFAULT_HAS_PREFIX=yes
|
DEFAULT_HAS_PREFIX=yes
|
||||||
DEFAULT_SEND_ENCRYPTED_ONLY=yes
|
DEFAULT_SEND_ENCRYPTED_ONLY=yes
|
||||||
@ -279,7 +280,7 @@ shift $(expr $OPTIND - 1)
|
|||||||
[[ $# -eq "0" ]] || usage "Wrong number of arguments!"
|
[[ $# -eq "0" ]] || usage "Wrong number of arguments!"
|
||||||
|
|
||||||
domain_exists=false
|
domain_exists=false
|
||||||
schleuder_domains="$(echo "select distinct substr(email, instr(email, '@') + 1) from lists" | sqlite3 -batch ${SCHLEUDER_HOME}/db.sqlite)"
|
schleuder_domains="$(schleuder-cli lists list 2>/dev/null | cut -d '@' -f2 2>/dev/null | sort -u 2>/dev/null)"
|
||||||
|
|
||||||
# - To avoid matching a substring we use an array
|
# - To avoid matching a substring we use an array
|
||||||
# -
|
# -
|
||||||
@ -818,13 +819,25 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echononl "Get fingerprint of the new list .."
|
echononl "Get fingerprint of the new list .."
|
||||||
FINGERPRINT="$(gpg2 --home "${SCHLEUDER_HOME}/lists/${LIST_DOMAIN}/$LIST_NAME" --fingerprint $FQ_LIST_ADDRESS 2>/dev/null | grep -o -E "[A-F=-9]{4}(\s*[A-F=-9]{4}){9}")"
|
_FINGERPRINT="$(schleuder-cli keys list ${FQ_LIST_ADDRESS} 2>/dev/null \
|
||||||
|
| grep ${FQ_LIST_ADDRESS} 2>/dev/null \
|
||||||
|
| cut -d' ' -f1 2>/dev/null)"
|
||||||
if [[ $? -eq 0 ]] ; then
|
if [[ $? -eq 0 ]] ; then
|
||||||
echo_done
|
echo_done
|
||||||
else
|
else
|
||||||
echo_failed
|
echo_failed
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
FINGERPRINT=""
|
||||||
|
declare -i number=1
|
||||||
|
while read -n1 char ; do
|
||||||
|
FINGERPRINT="${FINGERPRINT}$char"
|
||||||
|
if [[ $(( $number % 4)) -eq 0 ]] ; then
|
||||||
|
FINGERPRINT="${FINGERPRINT} "
|
||||||
|
fi
|
||||||
|
(( number++ ))
|
||||||
|
done <<< $_FINGERPRINT
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
|
|
||||||
---
|
---
|
||||||
|
Loading…
Reference in New Issue
Block a user