diff options
author | 2016-03-23 13:31:25 +0300 | |
---|---|---|
committer | 2016-03-23 13:31:25 +0300 | |
commit | 81452b25d5c94c5da502af040d7b546dbc61dfdc (patch) | |
tree | 594d49a9d67c391751a85c35bede1284486cb4d2 /net-dialup/accel-ppp/files | |
parent | dev-libs/libressl: remove older versions (diff) | |
download | gentoo-81452b25d5c94c5da502af040d7b546dbc61dfdc.tar.gz gentoo-81452b25d5c94c5da502af040d7b546dbc61dfdc.tar.bz2 gentoo-81452b25d5c94c5da502af040d7b546dbc61dfdc.zip |
net-dialup/accel-ppp: version bump to 1.10.1
Port to EAPI 6, simplify init script,
unify variable names in conf.d file
Gentoo-Bug: 574414
Package-Manager: portage-2.2.28
Diffstat (limited to 'net-dialup/accel-ppp/files')
-rw-r--r-- | net-dialup/accel-ppp/files/accel-ppp.confd | 6 | ||||
-rw-r--r-- | net-dialup/accel-ppp/files/accel-ppp.initd | 34 |
2 files changed, 13 insertions, 27 deletions
diff --git a/net-dialup/accel-ppp/files/accel-ppp.confd b/net-dialup/accel-ppp/files/accel-ppp.confd index 7b95dfaf46b0..41073c6529c6 100644 --- a/net-dialup/accel-ppp/files/accel-ppp.confd +++ b/net-dialup/accel-ppp/files/accel-ppp.confd @@ -1,10 +1,10 @@ -# Config file for /etc/init.d/accel-pppd +# Config file for accel-pppd # Pid file -PID="/var/run/accel-ppp/accel-pppd.pid" +ACCEL_PPPD_PID="/run/accel-ppp/accel-pppd.pid" # Directory for radius attributes -RADATTR_DIR="/var/run/radattr" +RADATTR_DIR="/run/radattr" # Daemon options ACCEL_PPPD_OPTS="-d -c /etc/accel-ppp.conf" diff --git a/net-dialup/accel-ppp/files/accel-ppp.initd b/net-dialup/accel-ppp/files/accel-ppp.initd index d3f3891cd7a0..fd9cbad07caa 100644 --- a/net-dialup/accel-ppp/files/accel-ppp.initd +++ b/net-dialup/accel-ppp/files/accel-ppp.initd @@ -1,5 +1,5 @@ #!/sbin/runscript -# Copyright 1999-2013 Gentoo Foundation +# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License, v2 or later # $Id$ @@ -9,45 +9,31 @@ depend() { need net } -check_dir() { -# Check for directory existance, try to create it(if it's not exist yet) -# and throw error if it can not be done. -# Parameters: -# $1 - directory to check -# $2 - error message - if [[ ! -d $1 ]]; then - mkdir "$1" 2>/dev/null - if [[ $? != 0 ]]; then - eerror "$2" - exit 1 - fi - fi -} - -start() { +start_pre() { # Create directory for PID file - local piddir=$(dirname ${PID}) - check_dir "${piddir}" "Can not create directory $piddir for PID file" + checkpath -d -q "$(dirname ${ACCEL_PPPD_PID})" # Create default directory for radius attributes - check_dir "${RADATTR_DIR}" "Can not create directory ${RADATTR_DIR} for radius attributes" + checkpath -d -q "${RADATTR_DIR}" +} +start() { ebegin "Starting accel-pppd" - start-stop-daemon --start --quiet --exec /usr/sbin/accel-pppd -- ${ACCEL_PPPD_OPTS} -p ${PID} + start-stop-daemon --start --quiet --exec /usr/sbin/accel-pppd -- ${ACCEL_PPPD_OPTS} -p ${ACCEL_PPPD_PID} eend $? } stop() { ebegin "Stopping accel-pppd" - start-stop-daemon --stop --quiet --pidfile ${PID} + start-stop-daemon --stop --quiet --pidfile ${ACCEL_PPPD_PID} eend $? } reload() { - if [ ! -f ${PID} ]; then + if [ ! -f ${ACCEL_PPPD_PID} ]; then eerror "accel-pppd isn't running" return 1 fi ebegin "Reloading configuration" - start-stop-daemon --signal USR1 --pidfile ${PID} + start-stop-daemon --signal USR1 --pidfile ${ACCEL_PPPD_PID} eend $? } |