mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 10:50:16 +00:00
Add systemd override for wg-quick units that don't yet implement reload
- Discussed on pull request 1164
This commit is contained in:
parent
9955f1fc02
commit
d860f1d402
3 changed files with 13 additions and 0 deletions
|
@ -2037,6 +2037,13 @@ confOVPN(){
|
|||
}
|
||||
|
||||
confWireGuard(){
|
||||
# Reload job type is not yet available in wireguard-tools shipped with Ubuntu 20.04
|
||||
if ! grep -q 'ExecReload' /usr/lib/systemd/system/wg-quick@.service; then
|
||||
echo "::: Adding additional reload job type for wg-quick unit"
|
||||
$SUDOE install -m 644 "${pivpnFilesDir}"/files/etc/systemd/system/wg-quick@.service.d/override.conf /etc/systemd/system/wg-quick@.service.d/override.conf
|
||||
$SUDO systemctl daemon-reload
|
||||
fi
|
||||
|
||||
if [ -d /etc/wireguard ]; then
|
||||
# Backup the wireguard folder
|
||||
WIREGUARD_BACKUP="wireguard_$(date +%Y-%m-%d-%H%M%S).tar.gz"
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
[Service]
|
||||
ExecReload=/bin/bash -c 'exec /usr/bin/wg syncconf %i <(exec /usr/bin/wg-quick strip %i)'
|
|
@ -146,6 +146,10 @@ removeAll(){
|
|||
${UPDATE_PKG_CACHE} &> /dev/null & spinner $!
|
||||
fi
|
||||
|
||||
if [ -f /etc/systemd/system/wg-quick@.service.d/override.conf ]; then
|
||||
rm -f /etc/systemd/system/wg-quick@.service.d/override.conf
|
||||
fi
|
||||
|
||||
elif [ "${i}" = "unattended-upgrades" ]; then
|
||||
|
||||
rm -rf /var/log/unattended-upgrades
|
||||
|
|
Loading…
Reference in a new issue