grctest / GRC-Netdata

Netdata charts for Gridcoin
MIT License
7 stars 6 forks source link

gridcoins_netdata_stats.sh could not use alias set for grc #9

Closed iFoggz closed 7 years ago

iFoggz commented 7 years ago

I had one hell of a time getting alias to work and failed. I had the alias in .bashrc and it worked great with old source stats.sh method.

however as a service on ubuntu 16.04 the systemctl would not find grc command at all. I had to make a work around for myself. I don't know if I'm doing something wrong or what but any input would be nice.

The changes I made so it would work:

!/bin/bash

if pgrep "gridcoin" > /dev/null then GRCAPP='/usr/bin/gridcoinresearchd' GRCPATH='/home/gridcoin/.GridcoinResearch' "$GRCAPP" getinfo > "$GRCPATH"/getinfo.tmp && mv -f "$GRCPATH"/getinfo.tmp $ "$GRCAPP" getstakinginfo > "$GRCPATH"/getstakinginfo.tmp && mv -f "$GRCPATH$ "$GRCAPP" getdifficulty > "$GRCPATH"/difficulty.tmp && mv -f "$GRCPATH"/dif$ else

echo "Gridcoin is not running!"

exit 1

fi

normally with the alias before you would have to include datadir and user to run it as but service runs as user gridcoin so it is not needed. made GRCAPP so it'd take up less space each line. now it performs as it should for me. any ideas what i did wrong or? It kept saying grc command not found.

iFoggz commented 7 years ago

pull request #10

NickAnEngineer commented 7 years ago

Yeah, it does make sense not to use it here as it's more on a system level, it doesn't need to be easy to type.

iFoggz commented 7 years ago

this should be good to close with merge request #10