1 Star 0 Fork 34

菜鸟要学飞 / JS_TOOL

forked from 古月玄 / JS_TOOL 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
repair.sh 1.60 KB
一键复制 编辑 原始数据 按行查看 历史
root 提交于 2020-05-07 09:05 . .
#!/usr/bin/env bash
## Author: lan-tianxiang
## Source: https://github.com/lan-tianxiang/js_tool
## Modified: 2021-03-27
## Version: v0.0.2
dir_shell=$(dirname $(readlink -f "$0"))
dir_root=$dir_shell
dir_config=$dir_root/config
file_cookie=$dir_config/cookie.sh
[ -f /proc/1/cgroup ] && [[ -n $(cat /proc/1/cgroup | grep cpuset | grep scope) ]] && echo "docker无法使用此命令,抱歉" && exit 0
[ -s $file_cookie ] && cp $file_cookie $(dirname $dir_shell)/cookie.sh && echo "备份cookie成功"
pkill -9 node
bash $dir_shell/jd.sh paneloff
crontab -r
rm -rf $dir_shell
cd $(dirname $dir_shell)
function REINSTALLATION() {
echo -e "\n1. 获取源码"
git clone https://gitee.com/highdimen/js_tool.git $dir_shell
echo -e "\n2. 还原配置文件"
mkdir -p $dir_config
[ -f $(dirname $dir_shell)/cookie.sh ] && cp -rf $(dirname $dir_shell)/cookie.sh $file_cookie && rm -rf $(dirname $dir_shell)/cookie.sh && echo "还原配置文件成功"
[ ! -f $dir_shell/config/config.sh ] && cp -f $dir_shell/sample/config.sh.sample $dir_shell/config/config.sh
[ ! -f $dir_shell/config/cookie.sh ] && cp -f $dir_shell/sample/cookie.sh.sample $dir_shell/config/cookie.sh
[ ! -f $dir_shell/config/crontab.list ] && cp -f $$dir_shell/sample/crontab.list.sample $dir_shell/config/crontab.list
[ ! -f $dir_shell/config/sharecode.sh ] && cp -f $dir_shell/sample/sharecode.sh.sample $dir_shell/config/sharecode.sh
echo -e "\n3. 执行脚本更新以及定时文件更新"
npm config set registry https://registry.npm.taobao.org
bash $dir_shell/jd.sh update
echo -e "\n修复完成!!!!"
}
REINSTALLATION
1
https://gitee.com/newbiebird/js_tool.git
git@gitee.com:newbiebird/js_tool.git
newbiebird
js_tool
JS_TOOL
A1

搜索帮助

53164aa7 5694891 3bd8fe86 5694891