diff options
author | Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org> | 2006-02-15 23:23:07 +0000 |
---|---|---|
committer | Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org> | 2006-02-15 23:23:07 +0000 |
commit | 1d319322bcb27a7576ae7fc47854d0d39e39fc21 (patch) | |
tree | f41ed459e38e69c4a3498a795c5de3ca40a135a7 /net-p2p | |
parent | 756c29568076da3694b75e2bfba124e5a8f2db22 (diff) | |
download | ports-1d319322bcb27a7576ae7fc47854d0d39e39fc21.tar.gz ports-1d319322bcb27a7576ae7fc47854d0d39e39fc21.zip |
Notes
Diffstat (limited to 'net-p2p')
-rw-r--r-- | net-p2p/mldonkey-devel/Makefile | 2 | ||||
-rw-r--r-- | net-p2p/mldonkey-devel/files/mlnet.in | 40 | ||||
-rw-r--r-- | net-p2p/mldonkey-devel/files/mlnet.sh | 40 |
3 files changed, 51 insertions, 31 deletions
diff --git a/net-p2p/mldonkey-devel/Makefile b/net-p2p/mldonkey-devel/Makefile index 58bdabac17b4..6123bcbdec24 100644 --- a/net-p2p/mldonkey-devel/Makefile +++ b/net-p2p/mldonkey-devel/Makefile @@ -7,7 +7,7 @@ PORTNAME= mldonkey PORTVERSION= 2.7.3 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES+= net-p2p MASTER_SITES= ${MASTER_SITE_SAVANNAH} MASTER_SITE_SUBDIR= ${PORTNAME} diff --git a/net-p2p/mldonkey-devel/files/mlnet.in b/net-p2p/mldonkey-devel/files/mlnet.in index 82edeb6d8272..f03ef1e46de3 100644 --- a/net-p2p/mldonkey-devel/files/mlnet.in +++ b/net-p2p/mldonkey-devel/files/mlnet.in @@ -13,6 +13,7 @@ # #mlnet_enable="YES" #mlnet_user="" +#mlnet_flags="" #mlnet_logfile="" # @@ -20,40 +21,49 @@ name="mlnet" rcvar=`set_rcvar` -command="%%PREFIX%%/bin/mlnet" -procname="%%PREFIX%%/bin/mlnet-real" +command="%%PREFIX%%/bin/${name}" +procname="%%PREFIX%%/bin/${name}-real" -## hardcoded, cannot override -mlnet_pidfile="${HOME}/.mldonkey/mlnet.pid" +load_rc_config "${name}" +: ${mlnet_enable="NO"} +: ${mlnet_user="$(whoami)"} +: ${mlnet_flags=""} +: ${mlnet_logfile=""} + +pidfile="$(eval echo ~${mlnet_user}/.mldonkey/$(basename ${procname}).pid)" +required_dirs="$(eval echo ~${mlnet_user})" mlnet_check_vars() { - if [ -z "${mlnet_user}" ]; then - mlnet_user=$(whoami) - fi - if [ "x${mlnet_user}" = "xroot" ]; then - err 1 "You have to set mlnet_user to a non-root user for security reasons" + warn "You have to set mlnet_user to a non-root user for security reasons" + return 1 fi + + return 0 } +start_precmd="mlnet_check_vars" start_cmd="start_cmd" start_cmd() { - mlnet_check_vars if [ -n "${mlnet_logfile}" ]; then mlnet_logcommand="-log_file ${mlnet_logfile}" fi - su -l ${mlnet_user} -c "${command} \ + if [ "x${mlnet_user}" = "x$(whoami)" ]; then + eval "${command} \ ${mlnet_logcommand} \ ${mlnet_flags} \ >/dev/null &" + else + su -l ${mlnet_user} -c "${command} \ + ${mlnet_logcommand} \ + ${mlnet_flags} \ + >/dev/null &" + fi } -load_rc_config "${name}" -: ${mlnet_enable="NO"} -: ${mlnet_user=""} -: ${mlnet_logfile=""} +stop_precmd="mlnet_check_vars" run_rc_command "$1" diff --git a/net-p2p/mldonkey-devel/files/mlnet.sh b/net-p2p/mldonkey-devel/files/mlnet.sh index 82edeb6d8272..f03ef1e46de3 100644 --- a/net-p2p/mldonkey-devel/files/mlnet.sh +++ b/net-p2p/mldonkey-devel/files/mlnet.sh @@ -13,6 +13,7 @@ # #mlnet_enable="YES" #mlnet_user="" +#mlnet_flags="" #mlnet_logfile="" # @@ -20,40 +21,49 @@ name="mlnet" rcvar=`set_rcvar` -command="%%PREFIX%%/bin/mlnet" -procname="%%PREFIX%%/bin/mlnet-real" +command="%%PREFIX%%/bin/${name}" +procname="%%PREFIX%%/bin/${name}-real" -## hardcoded, cannot override -mlnet_pidfile="${HOME}/.mldonkey/mlnet.pid" +load_rc_config "${name}" +: ${mlnet_enable="NO"} +: ${mlnet_user="$(whoami)"} +: ${mlnet_flags=""} +: ${mlnet_logfile=""} + +pidfile="$(eval echo ~${mlnet_user}/.mldonkey/$(basename ${procname}).pid)" +required_dirs="$(eval echo ~${mlnet_user})" mlnet_check_vars() { - if [ -z "${mlnet_user}" ]; then - mlnet_user=$(whoami) - fi - if [ "x${mlnet_user}" = "xroot" ]; then - err 1 "You have to set mlnet_user to a non-root user for security reasons" + warn "You have to set mlnet_user to a non-root user for security reasons" + return 1 fi + + return 0 } +start_precmd="mlnet_check_vars" start_cmd="start_cmd" start_cmd() { - mlnet_check_vars if [ -n "${mlnet_logfile}" ]; then mlnet_logcommand="-log_file ${mlnet_logfile}" fi - su -l ${mlnet_user} -c "${command} \ + if [ "x${mlnet_user}" = "x$(whoami)" ]; then + eval "${command} \ ${mlnet_logcommand} \ ${mlnet_flags} \ >/dev/null &" + else + su -l ${mlnet_user} -c "${command} \ + ${mlnet_logcommand} \ + ${mlnet_flags} \ + >/dev/null &" + fi } -load_rc_config "${name}" -: ${mlnet_enable="NO"} -: ${mlnet_user=""} -: ${mlnet_logfile=""} +stop_precmd="mlnet_check_vars" run_rc_command "$1" |