aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Shelton <stuart@shelton.me>2016-01-11 02:47:57 +0000
committerStuart Shelton <stuart@shelton.me>2016-01-11 02:47:57 +0000
commitd179b75b1620b57cfc97471f7b329e1842faac8a (patch)
treef19b781ef9bc3e449539f0a185969d668a1fe240 /net-dialup
parentAdd sys-power/apcupsd-3.14.13 (diff)
downloadsrcshelton-d179b75b1620b57cfc97471f7b329e1842faac8a.tar.gz
srcshelton-d179b75b1620b57cfc97471f7b329e1842faac8a.tar.bz2
srcshelton-d179b75b1620b57cfc97471f7b329e1842faac8a.zip
Update init scripts to remove bash-specific syntax
Diffstat (limited to 'net-dialup')
-rw-r--r--net-dialup/openl2tp/Manifest2
-rw-r--r--net-dialup/openl2tp/files/openl2tpd.initd-296
2 files changed, 53 insertions, 45 deletions
diff --git a/net-dialup/openl2tp/Manifest b/net-dialup/openl2tp/Manifest
index 1f808de9..b79aeb90 100644
--- a/net-dialup/openl2tp/Manifest
+++ b/net-dialup/openl2tp/Manifest
@@ -13,6 +13,6 @@ AUX openl2tp-1.8-pppd-2.patch 485 SHA256 5385e280d2c7db0b6bea1389295ae39b961f7cb
AUX openl2tp-1.8-setkey.patch 483 SHA256 66f7a8de192525a0eb538493465023ec4530215ef87ad0540eb644d4b1bbdc95 SHA512 da1935e969d8100230434cf6393696563220ecf3785712e1ceb0922e34034624e5a9999671721e530ad74368fab9d89d403677b417934e379fedd5060463e3ab WHIRLPOOL fb57255757e06e62bcd287a6d9caf1f5ff17bfb99b77d2a4b4eab40571712b09f6d9d2f56ad3415cc72ce0084c3d75ae9d2c7abfe1a1a841774f8d7f6719db65
AUX openl2tp-1.8-werror.patch 1466 SHA256 5da5272f697d803c71256f298070c3a9783c1e8e43c890576a4615a407e069aa SHA512 99967159458f9ee806b72372142a5895793daad46b4aa9a6f0876eafc9c89b2016d72883c6c77adee6cebd4126fb9ba463b2b8bf7119456a4ea72d86374fb10d WHIRLPOOL b376069cb8e219efcaf6f2547f8f6efd2f44217ba87b8276c3490c58cf575694b5de902bbed9b88abed5b22e70d51aac0861f31f1596bce9f16c7c4f78e0b3fb
AUX openl2tpd.confd 717 SHA256 30a62fc00e72f3e5220ea8505b7f5f009b18c793e3e24d48d96904d9267c378e SHA512 b120c80c352cfb810f808722a5fbbc63519e07b72f16a1b42f4e577da9a4607b24e8ce82bf25ccd90c69ad640ad929be89c7e1e3fb429c61088ce93ddab2ceb4 WHIRLPOOL cb6a8f2fea6bc01e41153c3fb82b8afe30696970e2cfa2713fd428471b11c75e2deab745342be179c9568e2d61f0e533e4e4ae8f75d29e905eff965f7f208ec3
-AUX openl2tpd.initd-2 1738 SHA256 cef03de0be9313be94f0581314fb83266e6a29c949ea5bbfbbd9480e89b0d95e SHA512 47ac334c2370681ee3c1e751fd54aa53f659e306bc160cd246bd602e912f219cc9eb3368c158f880c76dfd5a08dabcbfd26a43e236675ddac25e450ff11b86d6 WHIRLPOOL 21d8efe6d30c7c65451e20cb6d4ce9cda1ed203c809894e563a8558bfb1b962e3fa9b4282bafc0e0f03ea84291c81b30374a527180941a2cd86faa0eaf16b960
+AUX openl2tpd.initd-2 1731 SHA256 3b624bfe884d8cc34e05d41a7698f387b4229d348fdc15a6dc715ac8f7b14ece SHA512 028016c26c02e0b65039571a152abc0c6db3e164b3c53a4727ff420e788046d3bc9e06d77c4f8495e4a32b5df25473f31018910bc2348d3efe5d8b738117d550 WHIRLPOOL a8a51f8030107904d7ff49f5d1ed49f66eb22738864eb7d10b9da1396cd84871342ec87a652e7d4a34bcfd242fbe5418be0c2ade73a3e52d97a9db096aa15e5c
DIST openl2tp-1.8.tar.gz 491160 SHA256 1c97704d4b963a87fbc0e741668d4530933991515ae9ab0dffd11b5444f4860f SHA512 360f9032b2bb104cfaa41a18fc37005510ab604b31a34a3412563e0de3e8dad946ca61840cd41a19f0202d92d758d812f45479659c9fa4d4e9e13dd226f03fda WHIRLPOOL 10988e77ede3574baf9b41ab9941f2caba60db3c27004173cac6947eab4bd85aceb62a15f8a60407c03e855a81283bf06c193c5c1e10843fbe8ff711bff934e2
EBUILD openl2tp-1.8-r6.ebuild 3193 SHA256 7c52f3d3c93738cf98262a4d0f42ba9000382fe4bdbccfbc57a99734d5187497 SHA512 12bb6d42a371a29e2b2e34380c058a3901a07ef11e363faf2337d704b77c3951261e410b5d4cd72ae3492919ff75060eed01079e76c1a6ed8ee352c6327b706a WHIRLPOOL e7494d075dab408fab65733a09a10e12c506e7ca36fc8a509a22444f529afe1cb3af17d905b21f6c65e626593cc5c2ef9eb2160580cb963c06a228f6124ece74
diff --git a/net-dialup/openl2tp/files/openl2tpd.initd-2 b/net-dialup/openl2tp/files/openl2tpd.initd-2
index 55d78766..7bcf1ad6 100644
--- a/net-dialup/openl2tp/files/openl2tpd.initd-2
+++ b/net-dialup/openl2tp/files/openl2tpd.initd-2
@@ -2,66 +2,74 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-userpc="yes"
+use_rpc="yes"
retry_count="40"
retry_delay="0.5"
-bin=/usr/sbin/openl2tpd
-pid=/var/run/openl2tpd.pid
-[[ -z "${OPENL2TPD_CONFIG_FILE}" ]] && OPENL2TPD_CONFIG_FILE="/etc/openl2tpd.conf"
+bin="/usr/sbin/openl2tpd"
+pid="/var/run/openl2tpd.pid"
+[ -z "${OPENL2TPD_CONFIG_FILE:-}" ] && OPENL2TPD_CONFIG_FILE="/etc/openl2tpd.conf"
depend() {
- need net
- [[ $userpc == "yes" ]] && need portmap
- use dns ipsec racoon ippoold
+ need net
+ [ "${use_rpc}" = "yes" ] && need portmap
+ use dns ipsec racoon ippoold
}
check_module () {
- if ! [[ -f /proc/net/pppol2tp ]]; then
- ebegin "Loading l2tp module"
- # try both new and old module names
- modprobe l2tp_ppp 2>/dev/null || modprobe pppol2tp 2>/dev/null
- eend $?
- fi
+ if ! [ -f /proc/net/pppol2tp ]; then
+ ebegin "Loading l2tp module"
+ # try both new and old module names
+ modprobe l2tp_ppp 2>/dev/null || modprobe pppol2tp 2>/dev/null
+ eend $?
+ fi
}
start() {
- check_module
- ebegin "Starting openl2tpd"
- # if rpc is enabled do not read config file by daemon (has bugs),
- # but read by l2tpconfig instead
- if [[ $userpc == "yes" ]]; then
- conf="/dev/null"
- else
- conf="${OPENL2TPD_CONFIG_FILE}"
- fi
+ local rc conf i
+ declare -i rc i
- start-stop-daemon --start --quiet --exec ${bin} --pidfile ${pid} \
- -- -c "$conf" ${OPENL2TPDARGS}
+ check_module
- # it is possible to not to have config at all
- if [[ $userpc == "yes" ]] && [[ -r "${OPENL2TPD_CONFIG_FILE}" ]]; then
- # on system startup it may take some time to load daemon
- for (( i=0; i<$retry_count; i++ )); do
- l2tpconfig config restore file="${OPENL2TPD_CONFIG_FILE}" >/dev/null 2>&1
- retcode=$?
- [[ $retcode == 0 ]] && break
- sleep $retry_delay
- done
- fi
- eend $retcode
+ ebegin "Starting openl2tpd"
+
+ # if rpc is enabled do not read config file by daemon (has bugs),
+ # but read by l2tpconfig instead
+ if [ "${use_rpc}" = "yes" ]; then
+ conf="/dev/null"
+ else
+ conf="${OPENL2TPD_CONFIG_FILE}"
+ fi
+
+ start-stop-daemon --start --quiet --pidfile ${pid} \
+ --exec "${bin}" -- -c "$conf" ${OPENL2TPDARGS}
+
+ # it is possible to not to have config at all
+ if [ "${use_rpc}" = "yes" ] && [ -r "${OPENL2TPD_CONFIG_FILE}" ]; then
+ # on system startup it may take some time to load daemon
+ : $(( i = 0 ))
+ while [ $(( i < retry_count )) -ne 0 ]; do
+ l2tpconfig config restore file="${OPENL2TPD_CONFIG_FILE}" >/dev/null 2>&1 ; rc=$?
+ [ "${rc}" = "0" ] && break
+ sleep ${retry_delay} 2>/dev/null || sleep 1
+ : $(( i = i + 1 ))
+ done
+ fi
+ eend ${rc}
}
stop() {
- local rc
- ebegin "Stopping openl2tpd"
- start-stop-daemon --stop --quiet --exec ${bin} --pidfile ${pid}
- rc=$?
+ local rc
+ declare -i rc
+
+ ebegin "Stopping openl2tpd"
+
+ start-stop-daemon --stop --quiet --exec "${bin}" --pidfile "${pid}" ; rc=$?
- if [[ ${RC_CMD} == "restart" ]]; then
- einfo "sleepinng for server to finalize connections"
- sleep 2
- fi
+ if [ "${RC_CMD}" = "restart" ]; then
+ einfo "Waiting for server to finalize connections ..."
+ sleep 2
+ fi
- eend ${rc}
+ eend ${rc}
}