-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ns-plug): restart service if connection goes down
Make sure that ns-plug always try to connect to the controller. This fix will allow automatica re-connection in case of disaster recovery of the remote controller. #978
- Loading branch information
Showing
3 changed files
with
27 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# Copyright (C) 2024 Nethesis S.r.l. | ||
# SPDX-License-Identifier: GPL-2.0-only | ||
# | ||
|
||
# Restart the ns-plug service when tun-nsplug goes down | ||
|
||
# the service can take a while to stop | ||
if /etc/init.d/ns-plug status ; then | ||
sleep 30 | ||
fi | ||
|
||
# Check if the service is NOT running | ||
if ! /etc/init.d/ns-plug status ; then | ||
exit 0 | ||
fi | ||
|
||
# Restart the service | ||
/etc/init.d/ns-plug restart |