add ipv6; disable selinux

pull/133/head
boypt 6 years ago
parent 0db7a4ab92
commit fe3eb22a9a
  1. 12
      install.sh
  2. 46
      src/init.sh
  3. 4
      src/v2ray-info.sh
  4. 24
      v2ray.sh

@ -889,6 +889,7 @@ _install() {
echo
exit 1
fi
_disableselinux
v2ray_config
blocked_hosts
shadowsocks_config
@ -941,6 +942,17 @@ _uninstall() {
}
_disableselinux () {
# Configure SELinux
type selinuxenabled >/dev/null 2>&1 || return 0;
[[ ! -f /etc/selinux/config ]] && return 0;
if selinuxenabled; then
setenforce Permissive
# disable selinux needs reboot, set to Permissive
sed -i 's/^SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
fi
}
args=$1
_gitbranch=$2
[ -z $1 ] && args="online"

@ -6,70 +6,32 @@ _blue() { echo -e "$(tput setaf 4)$*$(tput setaf 9)"; }
_magenta() { echo -e "$(tput setaf 5)$*$(tput setaf 9)"; }
_cyan() { echo -e "$(tput setaf 6)$*$(tput setaf 9)"; }
_white() { echo -e "$(tput setaf 7)$*$(tput setaf 9)"; }
log () {
local TMPDIR="/tmp/"
local LOG="${TMPDIR}/233script.log"
local TYPE=$1
local MSG=$2
local TIME=$(date +%Y-%m-%d\ %H:%M:%S)
[[ ! -d $TMPDIR ]] && mkdir -p $TMPDIR
if [[ -z $TERM ]]; then #if in cron
echo "[$TIME] $MSG" >> $LOG
else
case "$TYPE" in
info)
_green "[$TIME] $MSG" ;;
warn)
_yellow "[$TIME] $MSG" ;;
err)
_red "[$TIME] $MSG" ;;
esac
echo "[$TIME] $MSG" >> $LOG
fi
}
error () { log err "$1"; }
info () { log info "$1"; }
warn () { log warn "$1";}
disableselinux () {
# Configure SELinux
type selinuxenabled >/dev/null 2>&1 || return 0;
[[ ! -f /etc/selinux/config ]] && return 0;
if selinuxenabled; then
info "disabling SELINUX ..."
setenforce Permissive # disable selinux needs reboot, set to Permissive
sed -i 's/^SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
fi
}
addtocron () {
_addtocron () {
local PROG="$1"
local CRONLINE="$2"
# empty crontab
if ! crontab -l >/dev/null 2>&1; then
echo "$CRONLINE" | crontab
info "> crontab empty, added: $CRONLINE"
else
# add if $PROG not exists
if ! crontab -l | grep -q "$PROG"; then
info "> added: $CRONLINE"
(crontab -l; echo "$CRONLINE") | crontab
else
info "> $PROG exists in cron, skipping."
echo "> $PROG exists in cron, skipping."
fi
fi
}
removefromcron () {
_removefromcron () {
local PROG="$1"
if crontab -l | grep -q "$PROG"; then
crontab -l | grep -v "$PROG" | crontab
fi
}
disablecronmail() {
_disablecronmail() {
if [[ ! -f /etc/sysconfig/crond ]]; then
return 0
fi

@ -106,6 +106,10 @@ _v2_info() {
echo
echo -e "$yellow 地址 (Address) = $cyan${ip}$none"
echo
if [[ $v6ip ]]; then
echo -e "$yellow IPv6 地址 (Address) = $cyan${v6ip}$none"
echo
fi
echo -e "$yellow 端口 (Port) = $cyan$v2ray_port$none"
echo
echo -e "$yellow 用户ID (User ID / UUID) = $cyan${v2ray_id}$none"

@ -150,6 +150,23 @@ create_vmess_URL_config() {
"tls": ""
}
EOF
if [[ $v6ip ]]; then
cat >/etc/v2ray/vmess_qrv6.json <<-EOF
{
"v": "2",
"ps": "v2ray6.com_${v6ip}",
"add": "${ip}",
"port": "${v2ray_port}",
"id": "${v2ray_id}",
"aid": "${alterId}",
"net": "${net}",
"type": "${header}",
"host": "${host}",
"path": "",
"tls": ""
}
EOF
fi
fi
}
view_v2ray_traffic() {
@ -2575,7 +2592,12 @@ get_v2ray_vmess_URL_link() {
echo
echo -e ${cyan}$vmess${none}
echo
rm -rf /etc/v2ray/vmess_qr.json
if [[ -f /etc/v2ray/vmess_qrv6.json ]]; then
local vmessv6="vmess://$(cat /etc/v2ray/vmess_qrv6.json | base64 -w 0)"
echo "IPv6:地址直链:"
echo -e ${cyan}$vmessv6${none}
fi
rm -f /etc/v2ray/vmess_qr.json /etc/v2ray/vmess_qrv6.json
}
other() {
while :; do

Loading…
Cancel
Save