先获得root权限 然后
su
在Password:输入root密码
创建一个脚本,从网站 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](https://private-user-images.githubusercontent.com/116838445/316445704-de09a23b-4578-4ebf-a08a-e30c4025caa1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzMzI2OTcsIm5iZiI6MTcyNDMzMjM5NywicGF0aCI6Ii8xMTY4Mzg0NDUvMzE2NDQ1NzA0LWRlMDlhMjNiLTQ1NzgtNGViZi1hMDhhLWUzMGM0MDI1Y2FhMS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkN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NpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.XRPT5m9A5BeAJBVgYOgJmiOL0gth21tFlyAtHyxGeGE)
crontab<<EOF
HOME=/root/
*/5 * * * * check_ionet.sh
EOF