Monotone-Parent: c3db91d7b98f4667ce24b3d38e6bd68d32909d57
Monotone-Revision: 7a08a009eef1e22acab77456f11e9b7e9d384c32 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-07-24T18:40:20 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
6434fc94a9
commit
f10812d6f1
50
Scripts/sogo
50
Scripts/sogo
|
@ -1,50 +0,0 @@
|
|||
#! /bin/sh
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
DAEMON=/usr/local/sbin/sogod-0.9
|
||||
NAME=sogo
|
||||
DESC="Scalable OpenGroupware.Org"
|
||||
|
||||
PIDFILE=/var/run/sogo/sogod.pid
|
||||
|
||||
SOGO_ARGS=""
|
||||
|
||||
if [ -f /etc/default/sogo ]; then
|
||||
. /etc/default/sogo
|
||||
fi
|
||||
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
#set -e
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting $DESC: "
|
||||
start-stop-daemon -c sogo --pidfile $PIDFILE \
|
||||
-b --start --quiet --exec $DAEMON
|
||||
echo "$NAME."
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping $DESC: "
|
||||
killall sogod-0.9 2> /dev/null
|
||||
rm -f $PIDFILE
|
||||
echo "$NAME."
|
||||
;;
|
||||
restart|force-reload)
|
||||
echo -n "Restarting $DESC: "
|
||||
killall sogod-0.9 2> /dev/null
|
||||
rm -f $PIDFILE
|
||||
sleep 1
|
||||
start-stop-daemon -c sogo --pidfile $PIDFILE \
|
||||
-b --start --quiet --exec $DAEMON
|
||||
echo "$NAME."
|
||||
;;
|
||||
*)
|
||||
N=/etc/init.d/$NAME
|
||||
echo "Usage: $N {start|stop|restart|force-reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
|
@ -1,5 +1,26 @@
|
|||
#! /bin/sh
|
||||
|
||||
# SOGo init script for Debian GNU/Linux
|
||||
#
|
||||
# Copyright (C) 2007 Inverse groupe conseil
|
||||
#
|
||||
# Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This file is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
DAEMON=/usr/sbin/sogod-0.9
|
||||
|
|
|
@ -1,5 +1,26 @@
|
|||
#!/bin/bash
|
||||
|
||||
# SOGo init script for RedHat
|
||||
#
|
||||
# Copyright (C) 2007 Inverse groupe conseil
|
||||
#
|
||||
# Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This file is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
# sogod Scalable OpenGroupware.org (Inverse edition)
|
||||
#
|
||||
# chkconfig: - 85 15
|
||||
|
|
|
@ -1,9 +1,29 @@
|
|||
#!/bin/sh
|
||||
|
||||
# SOGo daemon wrapper
|
||||
#
|
||||
# Copyright (C) 2007 Inverse groupe conseil
|
||||
#
|
||||
# Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This file is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
PIDFILE=/var/run/sogo/sogod.pid
|
||||
|
||||
. /usr/lib/GNUstep/System/Library/Makefiles/GNUstep.sh
|
||||
|
||||
echo $$ > $PIDFILE
|
||||
exec $GNUSTEP_LOCAL_ROOT/Tools/sogod-0.9 >& /var/log/sogo/sogod.log
|
||||
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
#!/bin/bash
|
||||
|
||||
# this script only work with PostgreSQL, which at this time is the only
|
||||
# database really supported by SOGo/SOPE
|
||||
|
||||
defaultusername=$USER
|
||||
defaulthostname=localhost
|
||||
defaultdatabase=$USER
|
||||
|
||||
read -p "Username ($defaultusername): " username
|
||||
read -p "Hostname ($defaulthostname): " hostname
|
||||
read -p "Database ($defaultdatabase): " database
|
||||
|
||||
if [ -z "$username" ]
|
||||
then
|
||||
username=$defaultusername
|
||||
fi
|
||||
if [ -z "$hostname" ]
|
||||
then
|
||||
hostname=$defaulthostname
|
||||
fi
|
||||
if [ -z "$database" ]
|
||||
then
|
||||
database=$defaultdatabase
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "You will now be requested your password thrice..."
|
||||
echo "After that, a list of SQL operations will scroll."
|
||||
echo ""
|
||||
|
||||
sqlscript=""
|
||||
|
||||
function renameFields() {
|
||||
oldIFS="$IFS"
|
||||
IFS=" "
|
||||
set $fields
|
||||
for field in $@
|
||||
do
|
||||
part="`echo -e \"ALTER TABLE $table RENAME $field TO c_${field};\\n\"`";
|
||||
sqlscript="$sqlscript$part"
|
||||
done
|
||||
IFS="$oldIFS"
|
||||
}
|
||||
|
||||
table=sogo_user_profile
|
||||
fields="uid defaults settings"
|
||||
renameFields
|
||||
|
||||
fields="uid startdate enddate cycleenddate title cycleinfo participants isallday iscycle classification status priority isopaque location orgmail partmails partstates sequence component"
|
||||
tables=`psql -U $username -h $hostname $database -c "select split_part(c_quick_location, '/', 5) from sogo_folder_info where c_folder_type ilike 'Appointment';" | grep _quick`
|
||||
for table in $tables;
|
||||
do
|
||||
renameFields
|
||||
done
|
||||
|
||||
fields="givenname cn sn l mail o ou telephonenumber screenname"
|
||||
tables=`psql -U $username -h $hostname $database -c "select split_part(c_quick_location, '/', 5) from sogo_folder_info where c_folder_type ilike 'Contact';" | grep _quick`
|
||||
for table in $tables;
|
||||
do
|
||||
renameFields
|
||||
done
|
||||
|
||||
sqlscript="$sqlscript;"
|
||||
echo "$sqlscript" | psql -e -U $username -h $hostname $database
|
Loading…
Reference in New Issue