2 Star 2 Fork 4

冰羽... / shell

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
tor.sh 1.74 KB
一键复制 编辑 原始数据 按行查看 历史
root 提交于 2020-06-11 18:25 . 修复deban安装错误
#/bin/bash
#2020-05-13
#System
if [ -e /etc/redhat-release ]; then
OS=CentOS
Command="yum install -y epel-release tor net-tools"
[ -n "$(grep ' 7\.' /etc/redhat-release 2> /dev/null)" ] && OS_Ver=7
[ -n "$(grep ' 6\.' /etc/redhat-release 2> /dev/null)" ] && OS_Ver=6
elif [ -n "$(grep -i 'Debian' /etc/issue 2> /dev/null)" ]; then
OS=Debian
Command="apt-get -y update && apt-get -y install epel-release tor net-tools"
echo '[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99
[Install]
WantedBy=multi-user.target' >/etc/systemd/system/rc-local.service
systemctl enable rc-local && systemctl start rc-local.service
elif [ -n "$(grep -i 'Ubuntu' /etc/issue 2> /dev/null)" ]; then
OS=Ubuntu
Command="apt-get -y install epel-release tor net-tools"
echo "[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99
[Install]
WantedBy=multi-user.target" >/etc/systemd/system/rc-local.service
systemctl enable rc-local && systemctl start rc-local.service
else
echo "UnknownOS"
exit
fi
echo -e "\033[32m $OS $OS_Ver \033[0m"
$Command
echo -e "\033[32m Create user: \033[0m"
useradd tor -d /home/tor
chown -R tor:tor /home/tor && chown -R tor:tor /var/run/tor
chown -R tor:tor /etc/tor && chown -R tor:tor /run/tor
su - tor -c "/usr/bin/tor >>/etc/tor/tor.log&"
chmod 777 /etc/tor/tor.log
echo 'su - tor -c "/usr/bin/tor >>/etc/tor/tor.log&"' >>/etc/rc.local
chmod 755 /etc/rc.local
netstat -lnet|grep 9050
echo -e "\033[32m Done. \033[0m"
Shell
1
https://gitee.com/cnop/shell.git
git@gitee.com:cnop/shell.git
cnop
shell
shell
master

搜索帮助