Fix redirect text to sysctl config file

sudo echo hello > world doesn't work: sudo runs echo as root but the
redirection is executed as standard user.
This commit is contained in:
Orazio 2022-03-10 12:38:45 +01:00 committed by GitHub
parent 24b748f1bc
commit 14d9fc6a45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2196,7 +2196,7 @@ confNetwork(){
$SUDO sed -i '/net.ipv4.ip_forward=1/s/^#//g' /etc/sysctl.conf
if [ "$pivpnenableipv6" == "1" ]; then
$SUDO sed -i '/net.ipv6.conf.all.forwarding=1/s/^#//g' /etc/sysctl.conf
$SUDO echo "net.ipv6.conf.${IPv6dev}.accept_ra=2" > /etc/sysctl.d/99-pivpn.conf
echo "net.ipv6.conf.${IPv6dev}.accept_ra=2" | $SUDO tee /etc/sysctl.d/99-pivpn.conf > /dev/null
fi
$SUDO sysctl -p > /dev/null