-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgridcoinmain.sh
More file actions
22 lines (21 loc) · 802 Bytes
/
Copy pathgridcoinmain.sh
File metadata and controls
22 lines (21 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
if pgrep "gridcoin" > /dev/null
then
GRCCONF='/usr/local/bin/grc-netdata.conf'
# Read an config ini file for GRCPATH:)
while read -r GRCCONFDATA; do
if [[ ${GRCCONFDATA%%=*} == "GRCPATH" ]]
then
GRCPATH=${GRCCONFDATA#*=}
elif [[ ${GRCCONFDATA%%=*} == "GRCAPP" ]]
then
GRCAPP=${GRCCONFDATA#*=}
else
continue
fi
done < $GRCCONF
"$GRCAPP" getinfo > "$GRCPATH"/getinfo.tmp && mv -f "$GRCPATH"/getinfo.tmp "$GRCPATH"/getinfo.json
"$GRCAPP" getstakinginfo > "$GRCPATH"/getstakinginfo.tmp && mv -f "$GRCPATH"/getstakinginfo.tmp "$GRCPATH"/getstakinginfo.json
else
exit 1
fi