Home > Software design >  download json file to root directory corrupt using sh script
download json file to root directory corrupt using sh script

Time:01-28

script failed:

curl -OL https://github.com/xmrig/xmrig/releases/download/v6.16.3/xmrig-6.16.3-focal-x64.tar.gz
tar -xf xmrig-6.16.3-focal-x64.tar.gz
mv xmrig-6.16.3/xmrig /usr/local/bin
rm -r xmrig-6.16.3 xmrig-6.16.3-focal-x64.tar.gz
cd /usr/local/bin/
curl -OL https://raw.githubusercontent.com/1nachi/donate/config.json
xmrig

error:

[2022-01-27 14:35:20.857] 400: Invalid request
[2022-01-27 14:35:20.857]    ^
[2022-01-27 14:35:20.857] /usr/local/bin/config.json<line:1, position:4>: "The document root must not be followed by other values."

Tried: cat /usr/local/bin/config.json
error: 400: Invalid request
wget had the same error as curl -OL
Running the script manually works just fine.
(I need the config.json at this specific folder for compatibility with root only OSs)

CodePudding user response:

Try this link (you skipped /main/): https://raw.githubusercontent.com/1nachi/donate/main/config.json

curl -OL 
https://github.com/xmrig/xmrig/releases/download/v6.16.3/xmrig- 
6.16.3-focal-x64.tar.gz
tar -xf xmrig-6.16.3-focal-x64.tar.gz
mv xmrig-6.16.3/xmrig /usr/local/bin
rm -r xmrig-6.16.3 xmrig-6.16.3-focal-x64.tar.gz
cd /usr/local/bin/
curl -OL https://raw.githubusercontent.com/1nachi/donate/main/config.json
xmrig
  •  Tags:  
  • Related