Merge pull request #790 from micmac1/init-return
Treewide: Use return in init scripts instead of exit
This commit is contained in:
commit
ed951ea624
7 changed files with 11 additions and 11 deletions
|
@ -26,7 +26,7 @@ start_service() {
|
||||||
config_get_bool enabled general enabled 0
|
config_get_bool enabled general enabled 0
|
||||||
if [ $enabled -eq 0 ]; then
|
if [ $enabled -eq 0 ]; then
|
||||||
$LOGGER service not enabled in /etc/config/$NAME
|
$LOGGER service not enabled in /etc/config/$NAME
|
||||||
exit 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
config_get_bool log_stderr general log_stderr 1
|
config_get_bool log_stderr general log_stderr 1
|
||||||
|
|
|
@ -21,7 +21,7 @@ start_service() {
|
||||||
if [ "$ENABLE_BARESIP" != yes ]; then
|
if [ "$ENABLE_BARESIP" != yes ]; then
|
||||||
$LOGGER User configuration incomplete - not starting $DAEMON
|
$LOGGER User configuration incomplete - not starting $DAEMON
|
||||||
$LOGGER Check ENABLE_BARESIP in $DEFAULT
|
$LOGGER Check ENABLE_BARESIP in $DEFAULT
|
||||||
exit 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
procd_open_instance
|
procd_open_instance
|
||||||
|
|
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=coturn
|
PKG_NAME:=coturn
|
||||||
PKG_VERSION:=4.5.2
|
PKG_VERSION:=4.5.2
|
||||||
PKG_RELEASE:=4
|
PKG_RELEASE:=5
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=https://codeload.github.com/coturn/coturn/tar.gz/$(PKG_VERSION)?
|
PKG_SOURCE_URL:=https://codeload.github.com/coturn/coturn/tar.gz/$(PKG_VERSION)?
|
||||||
|
|
|
@ -20,7 +20,7 @@ start_service() {
|
||||||
config_get_bool enabled general enabled 0
|
config_get_bool enabled general enabled 0
|
||||||
if [ $enabled -eq 0 ]; then
|
if [ $enabled -eq 0 ]; then
|
||||||
$LOG_ERR service not enabled in /etc/config/$NAME
|
$LOG_ERR service not enabled in /etc/config/$NAME
|
||||||
exit 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
config_get_bool log_stderr general log_stderr 1
|
config_get_bool log_stderr general log_stderr 1
|
||||||
|
|
|
@ -26,7 +26,7 @@ start_service() {
|
||||||
config_get_bool enabled general enabled 0
|
config_get_bool enabled general enabled 0
|
||||||
if [ $enabled -eq 0 ]; then
|
if [ $enabled -eq 0 ]; then
|
||||||
$LOG_ERR service not enabled in /etc/config/$NAME
|
$LOG_ERR service not enabled in /etc/config/$NAME
|
||||||
exit 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
config_get_bool log_stderr general log_stderr 1
|
config_get_bool log_stderr general log_stderr 1
|
||||||
|
@ -46,7 +46,7 @@ start_service() {
|
||||||
$LOG_INFO using procd\'s default term_timeout
|
$LOG_INFO using procd\'s default term_timeout
|
||||||
elif ! [ 0 -lt "$term_timeout" ] 2>/dev/null; then
|
elif ! [ 0 -lt "$term_timeout" ] 2>/dev/null; then
|
||||||
$LOG_ERR invalid term_timeout in /etc/config/$NAME
|
$LOG_ERR invalid term_timeout in /etc/config/$NAME
|
||||||
exit 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for i in "$dir_localstate" "$dir_run"; do
|
for i in "$dir_localstate" "$dir_run"; do
|
||||||
|
|
|
@ -26,7 +26,7 @@ check_listen() {
|
||||||
|
|
||||||
[ -z "$value" ] && {
|
[ -z "$value" ] && {
|
||||||
$LOG_ERR empty $type entry
|
$LOG_ERR empty $type entry
|
||||||
exit 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# IPv6 addresses need to be enclosed in square brackets. If there are
|
# IPv6 addresses need to be enclosed in square brackets. If there are
|
||||||
|
@ -39,7 +39,7 @@ check_listen() {
|
||||||
# Bail if more than 2 colons.
|
# Bail if more than 2 colons.
|
||||||
[ $(echo "$value" | awk -F ":" '{print NF-1}') -gt 2 ] && {
|
[ $(echo "$value" | awk -F ":" '{print NF-1}') -gt 2 ] && {
|
||||||
$LOG_ERR init script does not understand $type entry \""$value"\"
|
$LOG_ERR init script does not understand $type entry \""$value"\"
|
||||||
exit 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
IFS=":" read one two three << EOF
|
IFS=":" read one two three << EOF
|
||||||
|
@ -93,7 +93,7 @@ start_service() {
|
||||||
|
|
||||||
if [ $enabled -eq 0 ]; then
|
if [ $enabled -eq 0 ]; then
|
||||||
$LOG_ERR service not enabled in /etc/config/$NAME
|
$LOG_ERR service not enabled in /etc/config/$NAME
|
||||||
exit 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
config_get user general user $NAME
|
config_get user general user $NAME
|
||||||
|
|
|
@ -48,13 +48,13 @@ check_ipaddr() {
|
||||||
|
|
||||||
[ -z "$value" ] && {
|
[ -z "$value" ] && {
|
||||||
$LOG_ERR empty $type entry
|
$LOG_ERR empty $type entry
|
||||||
exit 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Bail if more than 1 slash.
|
# Bail if more than 1 slash.
|
||||||
[ $(echo "$value" | awk -F "/" '{print NF-1}') -gt 1 ] && {
|
[ $(echo "$value" | awk -F "/" '{print NF-1}') -gt 1 ] && {
|
||||||
$LOG_ERR init script does not understand $type entry \""$value"\"
|
$LOG_ERR init script does not understand $type entry \""$value"\"
|
||||||
exit 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
IFS="/" read one two << EOF
|
IFS="/" read one two << EOF
|
||||||
|
|
Loading…
Reference in a new issue