干净的一键卸载宝塔面板WEB运行环境的方法
![]() | ![]() | ![]() | ![]() |
| 【性价之王】 | 【线路之王】 | 【价格之王】 | 【配置之王】 |
| 【免费之王】 | 【香港首推】 | 【梯子之王】 | 【独服之王】 |
现在国内用户使用宝塔面板用来建站的朋友非常多,如果你的VPS不想做网站了,需要卸载宝塔,一般的VPS商家都可以到后面直接重新安装新的系统,不过有一些商家的VPS是不支持重装系统的,像KT就需要发工单重新安装系统,那么有什么办法可以把宝塔全面卸载呢?今天就给大家分享一个脚本,到VPS里直接执行一下就可以把宝塔面板卸载掉。脚本如下:
保存成sh文件后,直接执行就可以, sh 文件名.sh
| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 | #!/bin/bashPATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/binexport PATHRemove_Bt(){if[!-f”/etc/init.d/bt”]||[!-d”/www/server/panel”];thenecho-e”此服务器没有安装宝塔!”echo-e”This server does not install bt-panel”exit;fi/etc/init.d/bt stopif[-f”/usr/sbin/chkconfig”];thenchkconfig–del btelif[-f”/usr/sbin/update-rc.d”];then/usr/sbin/update-rc.dfirm-rf/www/server/panelrm-f/etc/init.d/btecho-e”宝塔面板已卸载成功”echo-e”bt-panel uninstall success”}Remove_Service(){servicePath=”/www/server”forservice innginx httpd mysqld pure-ftpd tomcat redis memcached php-fpm-52php-fpm-53php-fpm-54php-fpm-55php-fpm-56php-fpm-70php-fpm-71doif[-f”/etc/init.d/${service}”];then/etc/init.d/${service}stopif[-f”/usr/sbin/chkconfig”];thenchkconfig –del${service}elif[-f”/usr/sbin/update-rc.d”];thenupdate-rc.d-f${service}removefiif[“${service}”=”mysqld”];thenrm-rf${servicePath}/mysqlrm-f/etc/my.cnfelif[“${service}”=”httpd”];thenrm-rf${servicePath}/apacheelif[“${service}”=”memcached”];thenrm-rf/usr/local/memcachedelif[“${service}”=”nginx”]||[“${service}”=”redis”]||[“${service}”=”tomcat”]||[“${service}”=”pure-ftpd”];thenrm-rf${servicePath}/${service}firm-f/etc/init.d/${service}echo-e${service}”33[32mclean33[0m”fidoneif[-d”${servicePath}/php”];thenrm-rf${servicePath}/phpfiif[-d”${servicePath}/nvm”];thenrm-rf${servicePath}/nvmfiif[-d”${servicePath}/phpmyadmin”];thenrm-rf${servicePath}/phpmyadminfiif[-f/opt/gitlab/embedded/service/gitlab-rails/Gemfile];thengitlab-ctl stopyum remove gitlab-ce-yrm-rf/opt/gitlabrm-rf/var/opt/gitlabrm-rf/etc/gitlabrm-rf/www/server/panel/plugin/gitlabfi}Remove_Rpm(){echo-e”查询已安装rpm包..”echo-e”Find installed packages”forlib inlibiconv-1.14libmcrypt-2.5.8mcrypt-2.6.8mhash-0.9.9.9bt-mysql bt-httpd bt-mariadb bt-php-5.2bt-php-5.3bt-php-5.4bt-php-5.5bt-php-5.6bt-php-7.0bt-php-7.1dorpm-qa|grep${lib}>${lib}.pllibRpm=`cat${lib}.pl`if[“${libRpm}”!=””];thenrpm-e${libRpm}–nodeps>/dev/null2>&1echo-e${lib}”33[32mclean33[0m”firm-f${lib}.pldoneecho-e”清理完毕”echo-e”Clean over”}Remove_Data(){rm-rf/www/server/datarm-rf/www/wwwlogsrm-rf/www/wwwroot}echo “=================================================”#echo -e “What you want to do ?(Default:1)”echo “1) 卸载宝塔”echo “2) 卸载宝塔及运行环境”#echo “3) 卸载宝塔及运行环境并清除所有站点相关数据”read -p “请选择你要进行的操作(1-2 默认:1): ” action;echo “=================================================”case $action in‘1’)Remove_Bt;;‘2’)Remove_Serviceif[-f”/usr/bin/yum”]&[-f”/usr/bin/rpm”];thenRemove_RpmfiRemove_Bt;;*)Remove_Bt;;esacrm -f bt-uninstall.sh |
效果如下:
好了,这样就把宝塔面板卸载了,不过最好的方法还是重装安装系统,才是最干净的。
原文:https://www.laozuo.org/13544.html
[kt]历史优惠活动内容
猜你可能想看的VPS
- bootstrap-table 多行重复表头的解决办法全球[VPS测评]
- Sharktech→KVM 七五折 2GB 30G SSD 4TB 洛杉全球[VPS测评]
- gigsgigscloud→洛杉矶 CN2 GIA $4.99 月 低配全球[VPS测评]
- 优惠 $7.98 半年 512M 内存 10G 硬盘 1T 流量@1Gb全球[VPS测评]
- Vultr 网络星期一→高性价比按小时计费商家 日本机房 新注册送$10日本VPS[主机]
- 便宜 $1.57 月 1 核 512M 内存 5G SSD 25Mbps全球[VPS测评]
- php 完美判断身份证号码是否有效(18 位)全球[VPS测评]
- 优惠 MoeCloud→美国原生 IP CN2 GIA 线路 可看奈飞 美国VPS[主机]
- thinkphp 实现文件下载全球[VPS测评]
- 新闻 Vultr 推出 Object Storage 系列 VPS 就是全球[VPS测评]
- WordPress 网站自定义广告位占位/出租代码全球[VPS测评]
- 我爱水煮鱼WordPress SEO 宝典:怎么才能让你的博客流量增长1全球[VPS测评]
- CloudCone VPS 复活节促销 1核512M年付14刀及简单评测全球[VPS测评]
- 微基主机 洛杉矶Cera高防VPS 1G内存/30G硬盘/CN2GIA/全球[VPS测评]
- 为什么有些网站的SEO排名总是靠前全球[VPS测评]
- Adamant-月付7$ 乌克兰 基辅 1C1G内存16G硬盘 100M全球[VPS测评]
- 外贸无界烟台市有多少跨境电商?烟台跨境电商开发平台,烟台跨境电商选品全球[VPS测评]
- 者也IO,香港日本美国云服务器促销,2核2G1000元/2年,7折+内存日本VPS[主机]
- “休闲养蜂”风靡海外跨境电商追逐垂直风口全球[VPS测评]
- 跨境电商平台首选香港服务器香港VPS[主机]
- 咖啡主机:享受7、8折促销 美国vps仅需15.4元/月 香港vps仅需美国VPS[主机]
- 言車新车|大阳VPS125混动踏板,长续航,代步通勤9980元起全球[VPS测评]
- 网站迁移服务器是如何运作的?新手站长看完这篇文章,很容易就能看完。全球[VPS测评]
- 互盟云元旦活动:云服务器1核2G首月仅18元,香港虚拟主机年付仅1折香港VPS[主机]
- 阿里行癫:如何理解当下的云计算全球[VPS测评]
- HostKvm:香港国际/美国洛杉矶七折优惠,其它业务全场八折,适合做站美国VPS[主机]
- 宝塔面板如何升级OpenSSL(亲测可用)全球[VPS测评]
- LOCVPS:香港vps八折优惠中,双十一预热,充值充600送150,六香港VPS[主机]
- 尊云双十二:国内4核4G5M云服务器仅28元/月,香港CN2VPS仅84香港VPS[主机]
- 月神科技:香港云服务器,2核2G5M年付200元/年;美国2核2G50M美国VPS[主机]
转载请注明原文地址:http://140.238.13.167:12355/read-157379.html











