diff --git a/config.json b/config.json index a32bb0e..bc43c1e 100644 --- a/config.json +++ b/config.json @@ -9,6 +9,7 @@ "verbose":0, "prefer_ipv6": false, "fast_open": true, + "no_delay": true, "reuse_port": true, "mptcp": true } \ No newline at end of file diff --git a/debian9-x86_64.sh b/debian9-x86_64.sh index 5ea8d5d..5a0bb7f 100644 --- a/debian9-x86_64.sh +++ b/debian9-x86_64.sh @@ -9,7 +9,7 @@ OPENVPN=${OPENVPN:-no} INTERFACE=${INTERFACE:-$(ip -o -4 route show to default | awk '{print $5}' | tr -d "\n")} DEBIAN_VERSION=$(sed 's/\..*//' /etc/debian_version) KERNEL_VERSION="4.14.77-mptcp-b3b861b" -OMR_VERSION="0.58" +OMR_VERSION="0.61" set -e umask 0022 @@ -22,10 +22,12 @@ fi if grep --quiet 'OpenMPCTProuter VPS' /etc/motd ; then sed -i 's/OpenMPCTProuter/OpenMPTCProuter/g' /etc/motd fi +# Check if OpenMPTCProuter VPS is already installed if grep --quiet 'OpenMPTCProuter VPS' /etc/motd ; then update="1" -fi -if grep --quiet 'OpenMPTCProuter VPS' /etc/motd.head ; then +elif grep --quiet 'OpenMPTCProuter VPS' /etc/motd.head ; then + update="1" +elif grep --quiet 'OpenMPTCProuter VPS' /root/openmptcprouter_config.txt ; then update="1" fi # Install mptcp kernel and shadowsocks @@ -88,7 +90,7 @@ if [ "$update" = "0" ]; then sed -i "s:MySecretKey:$SHADOWSOCKS_PASS_JSON:g" /etc/shadowsocks-libev/config.json fi sed -i 's:aes-256-cfb:chacha20:g' /etc/shadowsocks-libev/config.json -#sed -i 's:json:json --mptcp:g' /lib/systemd/system/shadowsocks-libev-server@.service +sed -i 's:json:json --no-delay:g' /lib/systemd/system/shadowsocks-libev-server@.service systemctl disable shadowsocks-libev systemctl enable shadowsocks-libev-server@config.service if [ $NBCPU -gt 1 ]; then @@ -264,16 +266,20 @@ fi # Add OpenMPTCProuter VPS script version to /etc/motd if [ -f /etc/motd.head ]; then if grep --quiet 'OpenMPTCProuter VPS' /etc/motd.head; then - sed -i 's:< OpenMPTCProuter VPS [0-9]*\.[0-9]* >:< OpenMPCTProuter VPS $OMR_VERSION >:' /etc/motd.head + sed -i "s:< OpenMPTCProuter VPS [0-9]*\.[0-9]* >:< OpenMPCTProuter VPS $OMR_VERSION >:" /etc/motd.head + sed -i "s:< OpenMPTCProuter VPS \$OMR_VERSION >:< OpenMPCTProuter VPS $OMR_VERSION >:" /etc/motd.head else - echo '< OpenMPTCProuter VPS $OMR_VERSION >' >> /etc/motd.head + echo "< OpenMPTCProuter VPS $OMR_VERSION >" >> /etc/motd.head fi elif [ -f /etc/motd ]; then if grep --quiet 'OpenMPTCProuter VPS' /etc/motd; then - sed -i 's:< OpenMPTCProuter VPS [0-9]*\.[0-9]* >:< OpenMPCTProuter VPS $OMR_VERSION >:' /etc/motd + sed -i "s:< OpenMPTCProuter VPS [0-9]*\.[0-9]* >:< OpenMPCTProuter VPS $OMR_VERSION >:" /etc/motd + sed -i "s:< OpenMPTCProuter VPS \$OMR_VERSION >:< OpenMPCTProuter VPS $OMR_VERSION >:" /etc/motd else - echo '< OpenMPTCProuter VPS $OMR_VERSION >' >> /etc/motd + echo "< OpenMPTCProuter VPS $OMR_VERSION >" >> /etc/motd fi +else + echo "< OpenMPTCProuter VPS $OMR_VERSION >" > /etc/motd fi if [ "$update" = "0" ]; then diff --git a/update-grub.sh b/update-grub.sh index 089fd21..e7d2a44 100755 --- a/update-grub.sh +++ b/update-grub.sh @@ -14,7 +14,9 @@ if [ -z "$(grep -m 1 vmlinuz $config_file | grep $kernel)" ]; then while IFS= read ln do if [ -n "$(echo $ln | grep $kernel)" ]; then - sed -i "s@^\(GRUB_DEFAULT=\).*@\1\"$x\"@" $deflt_file + x=$(expr $x - 1) + sed -i "s@^\(GRUB_DEFAULT=\).*@\1\"1>$x\"@" $deflt_file + [ -f /boot/grub/grub.cfg ] && grub-mkconfig -o /boot/grub/grub.cfg >/dev/null 2>&1 exit 0 fi x=$(expr $x + 1)