i2pd/debian/i2pd.openrc
Михаил Подивилов fdb0ce6703 I2P -> .NET
2019-05-11 18:25:50 +03:00

39 lines
941 B
Text

#!/sbin/openrc-run
pidfile="/var/run/dotnet/dotnet.pid"
logfile="/var/log/dotnet/dotnet.log"
mainconf="/etc/dotnet/dotnet.conf"
tunconf="/etc/dotnet/tunnels.conf"
tundir="/etc/dotnet/tunnels.conf.d"
name="dotnet"
command="/usr/sbin/dotnet"
command_args="--service --daemon --log=file --logfile=$logfile --conf=$mainconf --tunconf=$tunconf --tunnelsdir=$tundir --pidfile=$pidfile"
description="dotnet router written in C++"
required_dirs="/var/lib/dotnet"
required_files="$mainconf"
start_stop_daemon_args="--chuid dotnet"
depend() {
need mountall
use net
after bootmisc
}
start_pre() {
if [ -r /etc/default/dotnet ]; then
. /etc/default/dotnet
fi
if [ "x$DOTNET_ENABLED" != "xyes" ]; then
ewarn "dotnet disabled in /etc/default/dotnet"
exit 1
fi
checkpath -f -o dotnet:adm $logfile
checkpath -f -o dotnet:adm $pidfile
if [ -n "$DAEMON_OPTS" ]; then
command_args="$command_args $DAEMON_OPTS"
fi
}