This repository has been archived by the owner on Jan 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Added a message over the update of the module #24
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
#DEBHELPER# | ||
|
||
# Message of running rmmod & modprobe need to run after the module has been build. | ||
|
||
case "$1" in | ||
install) | ||
;; | ||
|
||
configure) | ||
# Check if the wireguard module is loaded else the install will fail. | ||
if [ ! -f "/sys/module/wireguard/version" ]; then | ||
echo "WARNING: kernel module is not loaded" | ||
exit 0 | ||
fi | ||
|
||
|
||
new="$(modinfo -F version "/lib/modules/$(uname -r)/updates/dkms/wireguard.ko" 2>/dev/null)" # Get the version of the current builded module | ||
old=`cat /sys/module/wireguard/version` # Get the version of the current loaded module | ||
if ! [ "$old" = "$new" ]; then | ||
echo "You appear to have just upgraded WireGuard from version v$old to v$new." | ||
echo "However, the old version is still running on your system. In order to use the" | ||
echo "new version, you will need to remove the old module and load the new one. As" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
echo "root, you can accomplish this with the following commands:" | ||
echo | ||
echo " # sudo rmmod wireguard" | ||
echo " # sudo modprobe wireguard" | ||
echo | ||
echo "Do note that doing this will remove current WireGuard interfaces, so you may want" | ||
echo "to gracefully remove them yourself prior." | ||
fi | ||
;; | ||
abort-upgrade) | ||
;; | ||
*) | ||
exit 0 | ||
;; | ||
esac | ||
|
||
|
||
exit 0 | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need this WARNING, since the kernel module is loaded ondemand.
However, you do need the exit 0 below, so keep that.