Commit 1883a216 authored by David Smith's avatar David Smith Committed by david

OK, committing this in the right place now

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@7998 b35dd754-fafc-0310-a699-88a17e54d16e
parent 41197e6a
#!/bin/sh
WILDFIRE_HOME=/usr/local/wildfire/
WILDFIRE_GID=`cat /private/tmp/wildfiregid`
rm /private/tmp/wildfiregid
OPENFIRE_HOME=/usr/local/openfire/
OPENFIRE_GID=`cat /private/tmp/openfiregid`
rm /private/tmp/openfiregid
chown -R wildfire $WILDFIRE_HOME
chgrp -R $WILDFIRE_GID $WILDFIRE_HOME
chown -R openfire $OPENFIRE_HOME
chgrp -R $OPENFIRE_GID $OPENFIRE_HOME
/bin/launchctl load /Library/LaunchDaemons/org.jivesoftware.wildfire.plist
/bin/launchctl load /Library/LaunchDaemons/org.jivesoftware.openfire.plist
#!/bin/sh
if [ -f /tmp/wildfire.xml ]; then
mv /tmp/wildfire.xml /usr/local/wildfire/conf/
if [ -f /tmp/openfire.xml ]; then
mv /tmp/openfire.xml /usr/local/openfire/conf/
fi
if [ -f /tmp/security ]; then
mv /tmp/security /usr/local/wildfire/resources/
mv /tmp/security /usr/local/openfire/resources/
fi
if [ -f /tmp/embedded-db ]; then
mv /tmp/embedded-db /usr/local/wildfire/embedded-db
mv /tmp/embedded-db /usr/local/openfire/embedded-db
fi
if [ -f /tmp/enterprise ]; then
mv /tmp/enterprise /usr/local/wildfire/enterprise
mv /tmp/enterprise /usr/local/openfire/enterprise
fi
if [ -f /tmp/plugins ]; then
mv /tmp/plugins /usr/local/wildfire/plugins
mv /tmp/plugins /usr/local/openfire/plugins
fi
WILDFIRE_HOME=/usr/local/wildfire/
WILDFIRE_GID=`cat /private/tmp/wildfiregid`
rm /private/tmp/wildfiregid
OPENFIRE_HOME=/usr/local/openfire/
OPENFIRE_GID=`cat /private/tmp/openfiregid`
rm /private/tmp/openfiregid
chown -R wildfire $WILDFIRE_HOME
chgrp -R $WILDFIRE_GID $WILDFIRE_HOME
chown -R openfire $OPENFIRE_HOME
chgrp -R $OPENFIRE_GID $OPENFIRE_HOME
/bin/launchctl load /Library/LaunchDaemons/org.jivesoftware.wildfire.plist
\ No newline at end of file
/bin/launchctl load /Library/LaunchDaemons/org.jivesoftware.openfire.plist
\ No newline at end of file
......@@ -5,49 +5,49 @@ NIUTIL_PRESENT=`which niutil`
if [ -z $NIUTIL_PRESENT] ; then
echo "No niutil"
WILDFIRE_USER=`dscl . -search /Users name wildfire | awk '{print $1}'`
OPENFIRE_USER=`dscl . -search /Users name openfire | awk '{print $1}'`
WILDFIRE_GID=`dscl . -readall /Users PrimaryGroupID | awk '/PrimaryGroupID/{print $2}' | sort -n | egrep -v "\b[5-9][0-9]{2,5}\b" | tail -n 1`
let "WILDFIRE_GID=$WILDFIRE_GID+1"
echo $WILDFIRE_GID > /private/tmp/wildfiregid
OPENFIRE_GID=`dscl . -readall /Users PrimaryGroupID | awk '/PrimaryGroupID/{print $2}' | sort -n | egrep -v "\b[5-9][0-9]{2,5}\b" | tail -n 1`
let "OPENFIRE_GID=$OPENFIRE_GID+1"
echo $OPENFIRE_GID > /private/tmp/openfiregid
if [ -z $WILDFIRE_USER ] ; then
WILDFIRE_UID=`dscl . -readall /Users UniqueID | awk '/UniqueID/{print $2}' | sort -n | egrep -v "\b[5-9][0-9]{2,5}\b" | tail -n 1`
let "WILDFIRE_UID=$WILDFIRE_UID+1"
echo $WILDFIRE_UID
if [ -z $OPENFIRE_USER ] ; then
OPENFIRE_UID=`dscl . -readall /Users UniqueID | awk '/UniqueID/{print $2}' | sort -n | egrep -v "\b[5-9][0-9]{2,5}\b" | tail -n 1`
let "OPENFIRE_UID=$OPENFIRE_UID+1"
echo $OPENFIRE_UID
#create user
dscl . -create /Users/wildfire
dscl . -create /Users/openfire
#set properties
dscl . -create /Users/wildfire PrimaryGroupID $WILDFIRE_GID
dscl . -create /Users/wildfire UniqueID $WILDFIRE_UID
dscl . -create /Users/wildfire UserShell /usr/bin/false
dscl . -create /Users/wildfire NFSHomeDirectory /usr/local/wildfire/
dscl . -create /Users/wildfire RealName "Jive Wildfire"
dscl . -passwd /Users/wildfire '*'
dscl . -create /Users/openfire PrimaryGroupID $OPENFIRE_GID
dscl . -create /Users/openfire UniqueID $OPENFIRE_UID
dscl . -create /Users/openfire UserShell /usr/bin/false
dscl . -create /Users/openfire NFSHomeDirectory /usr/local/openfire/
dscl . -create /Users/openfire RealName "Jive Openfire"
dscl . -passwd /Users/openfire '*'
fi
else
WILDFIRE_USER=`nireport / /users name | grep "wildfire"`
OPENFIRE_USER=`nireport / /users name | grep "openfire"`
WILDFIRE_GID=`nireport / /users gid | sort -n | egrep -v "\b[5-9][0-9]{2,5}\b" | tail -n 1`
let "WILDFIRE_GID=$WILDFIRE_GID+1"
echo $WILDFIRE_GID > /private/tmp/wildfiregid
OPENFIRE_GID=`nireport / /users gid | sort -n | egrep -v "\b[5-9][0-9]{2,5}\b" | tail -n 1`
let "OPENFIRE_GID=$OPENFIRE_GID+1"
echo $OPENFIRE_GID > /private/tmp/openfiregid
if [ -z $WILDFIRE_USER] ; then
WILDFIRE_UID=`nireport / /users uid | sort -n | egrep -v "\b[5-9][0-9]{2,5}\b" | tail -n 1`
let "WILDFIRE_UID=$WILDFIRE_UID+1"
echo $WILDFIRE_UID
if [ -z $OPENFIRE_USER] ; then
OPENFIRE_UID=`nireport / /users uid | sort -n | egrep -v "\b[5-9][0-9]{2,5}\b" | tail -n 1`
let "OPENFIRE_UID=$OPENFIRE_UID+1"
echo $OPENFIRE_UID
#create user
niutil -create . /users/wildfire
niutil -create . /users/openfire
#set properties
niutil -createprop . /users/wildfire gid $WILDFIRE_GID
niutil -createprop . /users/wildfire uid $WILDFIRE_UID
niutil -createprop . /users/wildfire shell /usr/bin/false
niutil -createprop . /users/wildfire home /usr/local/wildfire/
niutil -createprop . /users/wildfire realname "Jive Wildfire"
niutil -createprop . /users/wildfire passwd '*'
niutil -createprop . /users/openfire gid $OPENFIRE_GID
niutil -createprop . /users/openfire uid $OPENFIRE_UID
niutil -createprop . /users/openfire shell /usr/bin/false
niutil -createprop . /users/openfire home /usr/local/openfire/
niutil -createprop . /users/openfire realname "Jive Openfire"
niutil -createprop . /users/openfire passwd '*'
fi
fi
#!/bin/sh
# stop wildfire
/bin/launchctl unload /Library/LaunchDaemons/org.jivesoftware.wildfire.plist
if [ -f /usr/local/openfire ]; then
# stop openfire
/bin/launchctl unload /Library/LaunchDaemons/org.jivesoftware.openfire.plist
# preserve these files, they should never be upgraded
cp /usr/local/wildfire/conf/wildfire.xml /tmp/
cp -r /usr/local/wildfire/resources/security /tmp/
cp -r /usr/local/wildfire/embedded-db /tmp/
cp -r /usr/local/wildfire/enterprise /tmp/
cp -r /usr/local/wildfire/plugins /tmp/
cp /usr/local/openfire/conf/openfire.xml /tmp/
cp -r /usr/local/openfire/resources/security /tmp/
cp -r /usr/local/openfire/embedded-db /tmp/
cp -r /usr/local/openfire/enterprise /tmp/
cp -r /usr/local/openfire/plugins /tmp/
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment