From 5a77af8d33f8845e91a1bab99b5ed67a83accd85 Mon Sep 17 00:00:00 2001 From: 233boy Date: Mon, 25 Feb 2019 14:17:14 +0800 Subject: [PATCH] fix sed error --- src/backup.sh | 60 +++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/backup.sh b/src/backup.sh index c36be7a..93d3da3 100644 --- a/src/backup.sh +++ b/src/backup.sh @@ -3,94 +3,94 @@ _backup() { for keys in $*; do case $keys in v2ray_transport) - sed -i "/v2ray_transport=$v2ray_transport/v2ray_transport=$v2ray_transport_opt/" $backup + sed -i "s/v2ray_transport=$v2ray_transport/v2ray_transport=$v2ray_transport_opt/" $backup ;; v2ray_port) - sed -i "/v2ray_port=$v2ray_port/v2ray_port=$v2ray_port_opt/" $backup + sed -i "s/v2ray_port=$v2ray_port/v2ray_port=$v2ray_port_opt/" $backup ;; uuid) - sed -i "/v2ray_id=$v2ray_id/v2ray_id=$uuid/" $backup + sed -i "s/v2ray_id=$v2ray_id/v2ray_id=$uuid/" $backup ;; alterId) - sed -i "/alterId=$alterId/alterId=$new_alterId/" $backup + sed -i "s/alterId=$alterId/alterId=$new_alterId/" $backup ;; v2ray_dynamicPort_start) - sed -i "/v2ray_dynamicPort_start=$v2ray_dynamicPort_start/v2ray_dynamicPort_start=$v2ray_dynamic_port_start_input/" $backup + sed -i "s/v2ray_dynamicPort_start=$v2ray_dynamicPort_start/v2ray_dynamicPort_start=$v2ray_dynamic_port_start_input/" $backup ;; v2ray_dynamicPort_end) - sed -i "/v2ray_dynamicPort_end=$v2ray_dynamicPort_end/v2ray_dynamicPort_end=$v2ray_dynamic_port_end_input/" $backup + sed -i "s/v2ray_dynamicPort_end=$v2ray_dynamicPort_end/v2ray_dynamicPort_end=$v2ray_dynamic_port_end_input/" $backup ;; domain) - sed -i "/domain=$domain/domain=$new_domain/" $backup + sed -i "s/domain=$domain/domain=$new_domain/" $backup ;; caddy) - sed -i "/caddy=/caddy=true/" $backup + sed -i "s/caddy=/caddy=true/" $backup ;; +ss) - sed -i "/shadowsocks=/shadowsocks=true/; /ssport=$ssport/ssport=$new_ssport/; /sspass=$sspass/sspass=$new_sspass/; /ssciphers=$ssciphers/ssciphers=$new_ssciphers/" $backup + sed -i "s/shadowsocks=/shadowsocks=true/; s/ssport=$ssport/ssport=$new_ssport/; s/sspass=$sspass/sspass=$new_sspass/; s/ssciphers=$ssciphers/ssciphers=$new_ssciphers/" $backup ;; -ss) - sed -i "/shadowsocks=true/shadowsocks=/" $backup + sed -i "s/shadowsocks=true/shadowsocks=/" $backup ;; ssport) - sed -i "/ssport=$ssport/ssport=$new_ssport/" $backup + sed -i "s/ssport=$ssport/ssport=$new_ssport/" $backup ;; sspass) - sed -i "/sspass=$sspass/sspass=$new_sspass/" $backup + sed -i "s/sspass=$sspass/sspass=$new_sspass/" $backup ;; ssciphers) - sed -i "/ssciphers=$ssciphers/ssciphers=$new_ssciphers/" $backup + sed -i "s/ssciphers=$ssciphers/ssciphers=$new_ssciphers/" $backup ;; +ad) - sed -i "/ban_ad=/ban_ad=true/" $backup + sed -i "s/ban_ad=/ban_ad=true/" $backup ;; -ad) - sed -i "/ban_ad=true/ban_ad=/" $backup + sed -i "s/ban_ad=true/ban_ad=/" $backup ;; +path) - sed -i "/path_status=/path_status=true/; /path=$path/path=$new_path/; #proxy_site=$proxy_site#proxy_site=$new_proxy_site#" $backup + sed -i "s/path_status=/path_status=true/; s/path=$path/path=$new_path/; s#proxy_site=$proxy_site#proxy_site=$new_proxy_site#" $backup ;; -path) - sed -i "/path_status=true/path_status=/" $backup + sed -i "s/path_status=true/path_status=/" $backup ;; path) - sed -i "/path=$path/path=$new_path/" $backup + sed -i "s/path=$path/path=$new_path/" $backup ;; proxy_site) - sed -i "#proxy_site=$proxy_site#proxy_site=$new_proxy_site#" $backup + sed -i "s#proxy_site=$proxy_site#proxy_site=$new_proxy_site#" $backup ;; +socks) - sed -i "/socks=/socks=true/; /socks_port=$socks_port/socks_port=$new_socks_port/; /socks_username=$socks_username/socks_username=$new_socks_username/; /socks_userpass=$socks_userpass/socks_userpass=$new_socks_userpass/;" $backup + sed -i "s/socks=/socks=true/; s/socks_port=$socks_port/socks_port=$new_socks_port/; s/socks_username=$socks_username/socks_username=$new_socks_username/; s/socks_userpass=$socks_userpass/socks_userpass=$new_socks_userpass/;" $backup ;; -socks) - sed -i "/socks=true/socks=/" $backup + sed -i "s/socks=true/socks=/" $backup ;; socks_port) - sed -i "/socks_port=$socks_port/socks_port=$new_socks_port/" $backup + sed -i "s/socks_port=$socks_port/socks_port=$new_socks_port/" $backup ;; socks_username) - sed -i "/socks_username=$socks_username/socks_username=$new_socks_username/" $backup + sed -i "s/socks_username=$socks_username/socks_username=$new_socks_username/" $backup ;; socks_userpass) - sed -i "/socks_userpass=$socks_userpass/socks_userpass=$new_socks_userpass/" $backup + sed -i "s/socks_userpass=$socks_userpass/socks_userpass=$new_socks_userpass/" $backup ;; +mtproto) - sed -i "/mtproto=/mtproto=true/; /mtproto_port=$mtproto_port/mtproto_port=$new_mtproto_port/; /mtproto_secret=$mtproto_secret/mtproto_secret=$new_mtproto_secret/" $backup + sed -i "s/mtproto=/mtproto=true/; s/mtproto_port=$mtproto_port/mtproto_port=$new_mtproto_port/; s/mtproto_secret=$mtproto_secret/mtproto_secret=$new_mtproto_secret/" $backup ;; -mtproto) - sed -i "/mtproto=true/mtproto=/" $backup + sed -i "s/mtproto=true/mtproto=/" $backup ;; mtproto_port) - sed -i "/mtproto_port=$mtproto_port/mtproto_port=$new_mtproto_port/" $backup + sed -i "s/mtproto_port=$mtproto_port/mtproto_port=$new_mtproto_port/" $backup ;; mtproto_secret) - sed -i "/mtproto_secret=$mtproto_secret/mtproto_secret=$new_mtproto_secret/" $backup + sed -i "s/mtproto_secret=$mtproto_secret/mtproto_secret=$new_mtproto_secret/" $backup ;; +bt) - sed -i "/ban_bt=/ban_bt=true/" $backup + sed -i "s/ban_bt=/ban_bt=true/" $backup ;; -bt) - sed -i "/ban_bt=true/ban_bt=/" $backup + sed -i "s/ban_bt=true/ban_bt=/" $backup ;; esac done