Skip to content

Commit 0fcd6f7

Browse files
committed
feat(ns-plug): add restart script for ns-plug service
1 parent c034f31 commit 0fcd6f7

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

packages/ns-plug/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ define Package/ns-plug/install
7373
$(INSTALL_DIR) $(1)/usr/libexec/mwan-hooks
7474
$(INSTALL_BIN) ./files/ns-plug.init $(1)/etc/init.d/ns-plug
7575
$(INSTALL_BIN) ./files/ns-plug $(1)/usr/sbin/ns-plug
76+
$(INSTALL_BIN) ./files/restart-ns-plug $(1)/usr/sbin/restart-ns-plug
7677
$(INSTALL_BIN) ./files/distfeed-setup $(1)/usr/sbin/distfeed-setup
7778
$(INSTALL_BIN) ./files/remote-backup $(1)/usr/sbin
7879
$(INSTALL_BIN) ./files/send-backup $(1)/usr/sbin
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
#
4+
# Copyright (C) 2024 Nethesis S.r.l.
5+
# SPDX-License-Identifier: GPL-2.0-only
6+
#
7+
8+
# Restart the ns-plug service when tun-nsplug goes down
9+
10+
# the service can take a while to stop
11+
if /etc/init.d/ns-plug status ; then
12+
sleep 30
13+
fi
14+
15+
# Check if the service is NOT running
16+
if ! /etc/init.d/ns-plug status ; then
17+
exit 0
18+
fi
19+
20+
# Restart the service
21+
/etc/init.d/ns-plug restart

0 commit comments

Comments
 (0)