GithubHelp home page GithubHelp logo

ionet_restart's Introduction

监控并重启IONET脚本

1.进入wsl

先获得root权限 然后

su

在Password:输入root密码

2.创建脚本。

创建一个脚本,从网站 https://cloud.io.net/worker/devices 获取你的数据device_id、user_id、device_name,填入下边代码里

cat > /root/check_ionet.sh <<EOF 
#!/bin/bash
device_id="Yours device_id"#替换成你的
user_id="Yours user_id"#替换成你的
device_name="Yours device_name"#替换成你的
system=linux #linux or mac
gpu=false #false or true
if [[ "$system" == "linux" ]]; then
    os="Linux"
elif [[ "$system" == "mac" ]]; then
    os="macOS"
if [[ $(docker ps | grep -c "io-worker-monitor") -eq 1 && $(docker ps | grep -c "io-worker-vc") -eq 1 ]]; then
    echo "NODE IS WORKING"
else
    echo "STOP AND DELETE ALL CONTAINERS"
    docker rm -f $(docker ps -aq) && docker rmi -f $(docker images -q) 
    yes | docker system prune -a
    echo "DOWNLOAD FILES FOR $os"
    rm -rf launch_binary_$system && rm -rf ionet_device_cache.txt
    curl -L https://github.com/ionet-official/io_launch_binaries/raw/main/launch_binary_$system -o launch_binary_$system
    chmod +x launch_binary_$system
    echo "START NEW NODE"
    /root/launch_binary_$system --device_id=$device_id --user_id=$user_id --operating_system="$os" --usegpus=$gpu --device_name=$device_name
fi
EOF

复制上述代码,把device_id、user_id、device_name替换成你的之后,直接粘贴到命令行。这三个内容,从下图对应位置代码里可以找到。

image

3.修改脚本权限

chmod +x /root/check.sh

4.可以先运行一下,可以看到脚本正在运行。

/root/check.sh
image

5.将脚本加入到定时运行。

crontab<<EOF
HOME=/root/
*/5 * * * * check_ionet.sh
EOF

ionet_restart's People

Contributors

hbnnwwt avatar

Stargazers

Mocoonin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.