From 68c54ad5b537a7dfff7c939707bfe8f1a3023c46 Mon Sep 17 00:00:00 2001
From: Vivek Kumar Dutta <vivek.dutta@iopsys.eu>
Date: Thu, 12 Sep 2024 18:40:41 +0530
Subject: [PATCH] Fixed rpcd scripts

---
 .gitlab-ci.yml                              |  1 +
 files/ddns-script/usr/libexec/rpcd/ddnsmngr | 10 +++++-----
 files/inadyn/usr/libexec/rpcd/ddnsmngr      |  8 ++++----
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a7d0805..be83197 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -8,6 +8,7 @@ variables:
 include:
   - project: 'iopsys/gitlab-ci-pipeline'
     file: '/static-code-analysis.yml'
+    ref: '0.31'
 
 stages:
     - static_code_analysis
diff --git a/files/ddns-script/usr/libexec/rpcd/ddnsmngr b/files/ddns-script/usr/libexec/rpcd/ddnsmngr
index 6d64449..4cd383e 100644
--- a/files/ddns-script/usr/libexec/rpcd/ddnsmngr
+++ b/files/ddns-script/usr/libexec/rpcd/ddnsmngr
@@ -242,7 +242,7 @@ case "$1" in
 					json_init
 					json_add_string "last_update" "${last_update}"
 					json_dump
-					return
+					exit 0
 				fi
 
 				run_dir=$(uci -q get ddnsmngr.global.ddns_rundir)
@@ -257,7 +257,7 @@ case "$1" in
 					json_init
 					json_add_string "last_update" "${last_update}"
 					json_dump
-					return
+					exit 0
 				else
 					# strip next line from end
 					last_time=$(echo -e $last_time | tr -d '\n')
@@ -284,7 +284,7 @@ case "$1" in
 					json_init
 					json_add_string "status" "Error"
 					json_dump
-					return
+					exit 0
 				fi
 
 				state=$(get_hostname_status "${host_section}")
@@ -303,7 +303,7 @@ case "$1" in
 					json_init
 					json_add_string "status" "Error"
 					json_dump
-					return
+					exit 0
 				fi
 
 				state=$(get_client_status "${client_section}")
@@ -322,7 +322,7 @@ case "$1" in
 					json_init
 					json_add_string "last_error" "CONNECTION_ERROR"
 					json_dump
-					return
+					exit 0
 				fi
 
 				error=$(get_last_error "${client_section}")
diff --git a/files/inadyn/usr/libexec/rpcd/ddnsmngr b/files/inadyn/usr/libexec/rpcd/ddnsmngr
index c72dc68..fe8310f 100644
--- a/files/inadyn/usr/libexec/rpcd/ddnsmngr
+++ b/files/inadyn/usr/libexec/rpcd/ddnsmngr
@@ -225,7 +225,7 @@ case "$1" in
 					json_init
 					json_add_string "last_update" "${last_update}"
 					json_dump
-					return
+					exit 0
 				fi
 
 				hostname=$(uci -q get ddnsmngr.${host_section}.lookup_host)
@@ -255,7 +255,7 @@ case "$1" in
 					json_init
 					json_add_string "status" "Error"
 					json_dump
-					return
+					exit 0
 				fi
 
 				state=$(get_hostname_status "${host_section}")
@@ -277,7 +277,7 @@ case "$1" in
 					json_init
 					json_add_string "status" "Error"
 					json_dump
-					return
+					exit 0
 				fi
 
 				state=$(get_client_status "${client_section}")
@@ -296,7 +296,7 @@ case "$1" in
 					json_init
 					json_add_string "last_error" "CONNECTION_ERROR"
 					json_dump
-					return
+					exit 0
 				fi
 
 				error=$(get_last_error "${client_section}")
-- 
GitLab