#!/sbin/runscript # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 depend() { need net } start() { if [ ! -f "${GN_CONF}" ]; then eerror "You must create the config file first." return 1 fi ebegin "Starting GNUnet" if [ ! -f "${GN_LOG}" ]; then einfo "No '${GN_LOG}' around. Creating new..." touch "${GN_LOG}" chown "${GN_USER}:${GN_GROUP}" "${GN_LOG}" fi su -s /bin/sh ${GN_USER} -c \ "/usr/bin/gnunet-arm -q -c ${GN_CONF} -l ${GN_LOG} -s" eend $? "Failed to start GNUnet" } stop() { ebegin "Stopping GNUnet" su -s /bin/sh ${GN_USER} -c "/usr/bin/gnunet-arm -q -c ${GN_CONF} -e" eend $? "Failed to stop GNUnet" } restart() { ebegin "Stopping GNUnet" su -s /bin/sh ${GN_USER} -c \ "/usr/bin/gnunet-arm -q -c ${GN_CONF} -l ${GN_LOG} -r" eend $? "Failed to restart GNUnet" }