startdaemons.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/sh
  2. # StatusNet - a distributed open-source microblogging tool
  3. # Copyright (C) 2008, 2009, StatusNet, Inc.
  4. #
  5. # This program is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU Affero General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU Affero General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU Affero General Public License
  16. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. # This program tries to start the daemons for StatusNet.
  18. # Note that the 'maildaemon' needs to run as a mail filter.
  19. ARGSG=
  20. ARGSD=
  21. if [ $# -gt 0 ]; then
  22. ARGSG="$ARGSG -s$1"
  23. ID=`echo $1 | sed s/\\\\./_/g`
  24. ARGSD="$ARGSD -s$1 -i$ID"
  25. fi
  26. if [ $# -gt 1 ]; then
  27. ARGSD="$ARGSD -p$2"
  28. ARGSG="$ARGSG -p$2"
  29. fi
  30. DIR=`dirname $0`
  31. DAEMONS=`php $DIR/getvaliddaemons.php $ARGSG`
  32. for f in $DAEMONS; do
  33. echo "Starting $f..."
  34. php $f $ARGSD
  35. echo "DONE."
  36. done