File ccnet-init_helper.sh of Package ccnet

#!/bin/bash
# helper for ccnet-init.service
## Init ccnet configuration directory

CCNET_INIT="/usr/bin/ccnet-init"

case $1 in
  client) # /etc/ccnet/ccnet.conf
	  $CCNET_INIT -n $(hostname -s)
	  chown -R seafile:root /etc/ccnet/
  ;;
  cluster) # /etc/ccnet/cluster
	   $CCNET_INIT -t $1 -n $(hostname -s)
	  chown -R seafile:root /etc/ccnet/cluster
  ;;
  server) # /etc/ccnet/server
	  $CCNET_INIT -t $1 -n $(hostname -s) -H $(hostname -f) -P 10001
	  chown -R seafile:root /etc/ccnet/server
  ;;
  *) echo "unknown PARAM; exit 1"
  ;;
esac

# finally clean exit
exit 0