1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-vps.git synced 2025-03-09 15:50:00 +00:00

Add glorytun udp server support and a service to set 6in4 tunnel

This commit is contained in:
Ycarus (Yannick Chabanois) 2018-06-01 13:11:58 +00:00
parent a7264f0746
commit 04c961d9ab
13 changed files with 144 additions and 33 deletions

22
update-grub.sh Executable file
View file

@ -0,0 +1,22 @@
#!/bin/bash
kernel=$1
[ -z "$kernel" ] && exit 0
config_file="$(find /boot/grub* -maxdepth 1 -name grub.cfg 2>/dev/null)"
[ $config_file ] || exit 0
deflt_file="$(find /etc/default \( -name grub -o -name grub2 \) 2>/dev/null)"
[ $deflt_file ] || exit 0
if [ -z "$(grep -m 1 vmlinuz $config_file | grep $kernel)" ]; then
x=0
sed -n -e 's@\([^'\"\'']*\)['\"\'']\([^'\"\'']*\).*@\1\2@' -e '/\(menuentry\) /p' <$config_file | \
while IFS= read ln
do
if [ -n "$(echo $ln | grep $kernel)" ]; then
sed -i "s@^\(GRUB_DEFAULT=\).*@\1\"$x\"@" $deflt_file
exit 0
fi
x=$(expr $x + 1)
done | sed 's@\(menuentry\) @@'
fi