Projects
Kolab:3.4
cyrus-imapd
cyrus-imapd.cvt_cyrusdb_all
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File cyrus-imapd.cvt_cyrusdb_all of Package cyrus-imapd (Revision 118)
Currently displaying revision
118
,
Show latest
#!/bin/bash # Simplified version of Simon Matter's cvt_cyrusdb_all. [ -f "/etc/sysconfig/cyrus-imapd" ] && \ . /etc/sysconfig/cyrus-imapd [ -f "/etc/default/cyrus-imapd" ] && \ . /etc/default/cyrus-imapd # Ensure this script is run as the cyrus user. if [ -x "$(which runuser 2>/dev/null)" ]; then SWITCHUSER=runuser else SWITCHUSER=su fi #if [ ! $(whoami) = "cyrus" ]; then # exec $SWITCHUSER -s /bin/bash - cyrus -c "cd \$HOME < /dev/null ; INSTANCE=$0 $*" #fi declare -a dbs declare -a db_paths dbs[${#dbs[@]}]="annotation_db"; db_paths[${#db_paths[@]}]="annotations.db" dbs[${#dbs[@]}]="duplicate_db"; db_paths[${#db_paths[@]}]="deliver.db" dbs[${#dbs[@]}]="mboxkey_db"; db_paths[${#db_paths[@]}]="" dbs[${#dbs[@]}]="mboxlist_db"; db_paths[${#db_paths[@]}]="mailboxes.db" dbs[${#dbs[@]}]="ptscache_db"; db_paths[${#db_paths[@]}]="annotations.db" dbs[${#dbs[@]}]="quota_db"; db_paths[${#db_paths[@]}]="quotas.db" dbs[${#dbs[@]}]="seenstate_db"; db_paths[${#db_paths[@]}]="" dbs[${#dbs[@]}]="statuscache_db"; db_paths[${#db_paths[@]}]="statuscache.db" dbs[${#dbs[@]}]="subscription_db"; db_paths[${#db_paths[@]}]="" dbs[${#dbs[@]}]="tls_sessions_db"; db_paths[${#db_paths[@]}]="tls_sessions.db" dbs[${#dbs[@]}]="userdeny_db"; db_paths[${#db_paths[@]}]="user_deny.db" # /usr/lib/cyrus-imapd/cyr_dbtool /var/lib/imap/annotations.db skiplist consistent; echo $? # Yes, consistent # 0 function cvt_database() { echo "would convert $1" } function get_config() { echo $(/usr/lib/cyrus-imapd/cyr_info conf | grep -E "^$1:\s+" | sed -r -e 's/[a-z0-9_-]+\:(.*)/\1/g') } function get_config_default() { echo $(/usr/lib/cyrus-imapd/cyr_info allconf | grep -E "^$1:\s+" | sed -r -e 's/[a-z0-9_-]+\:(.*)/\1/g') } function get_current() { value=$(/usr/lib/cyrus-imapd/cyr_info allconf | grep -E "^$1_path:\s+" | sed -r -e 's/[a-z0-9_-]+\:(.*)/\1/g') if [ -z "${value}" ]; then value="/var/lib/imap/annotations.db" fi } annotation_db=$(get_config "annotation_db") annotation_db_current=$(get_current "annotation_db") annotation_db_default=$(get_config_default "annotation_db") if [ ! -z "${annotation_db}" ]; then echo "annotation_db format configured to be ${annotation_db}" if [ ! -z "${annotation_db_default}" ]; then echo "annotation_db default format is ${annotation_db_default}" if [ "${annotation_db}" != "${annotation_db_default}" ]; then cvt_database annotation_db echo "those two do not match" else echo "configured and default match" fi else echo "default not known" fi else if [ ! -z "${annotation_db_default}" ]; then echo "annotation_db default format is ${annotation_db_default}" if [ "${annotation_db}" != "${annotation_db_default}" ]; then cvt_database annotation_db echo "those two do not match" else echo "configured and default match" fi else echo "default not known" fi fi echo "annotation db: ${annotation_db}" echo "annotation db (default): ${annotation_db_default}"
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.