Feat: enable-wireguard-lxc
This commit is contained in:
parent
bb2ac9e3e6
commit
239ac6780f
24
bin/enable-wireguard-lxc
Executable file
24
bin/enable-wireguard-lxc
Executable file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
_targetFile="/etc/pve/lxc/$1.conf"
|
||||
|
||||
if ! [[ -e "$_targetFile" ]]; then
|
||||
echo -n "pct container ID $1 not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 'lxc.cgroup2.devices.allow: c 10:200 rwm' >> "$_targetFile" &&
|
||||
echo 'lxc.mount.entry: /dev/net dev/net none bind,create=dir' >> "$_targetFile" &&
|
||||
|
||||
echo "done with configuration changes!"
|
||||
|
||||
read -p "restart container to apply changes?" -n 1 -r; echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||
|
||||
then
|
||||
pct stop "$1"
|
||||
pct start "$1"
|
||||
fi
|
||||
|
||||
echo "fin"
|
Loading…
Reference in New Issue
Block a user