Skip to content

Commit

Permalink
Merge pull request #31 from 71ae/ZIL-3
Browse files Browse the repository at this point in the history
Release v1.1
  • Loading branch information
71ae authored Aug 5, 2019
2 parents 81149b0 + dfce06d commit 4a34e23
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 9 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ You need to own a wallet address for ZIL.

### Installation

Run the following command in your ethOS shell:
Run the following commands in your ethOS shell:

```
sudo apt-get-ubuntu install curl
bash <(curl -s https://raw.githubusercontent.com/71ae/crypto-zil-miner-switch-ethos/v1.0/install-zil.sh)
bash <(curl -s https://raw.githubusercontent.com/71ae/crypto-zil-miner-switch-ethos/v1.1/install-zil.sh)
```

### Configuration
Expand All @@ -57,7 +56,7 @@ nano zil-miner-switch/minerpool.txt

After you've done this, you can start this toolsuite with:
```
sh zil-miner-switch/zil-init.sh
bash zil-miner-switch/zil-init.sh
```

To make sure the ZIL Mining Switcher also starts when you power on your rig,
Expand All @@ -83,7 +82,7 @@ rm zil-miner-switch/mineropts.txt

For upgrading just run the installer command again.
```
bash <(curl -s https://raw.githubusercontent.com/71ae/crypto-zil-miner-switch-ethos/v1.0/install-zil.sh)
bash <(curl -s https://raw.githubusercontent.com/71ae/crypto-zil-miner-switch-ethos/v1.1/install-zil.sh)
```

### Verification
Expand Down
6 changes: 3 additions & 3 deletions install-zil.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ cd crypto-zil-miner-switch-ethos

# Copy files to target directory
cd ~
[ ! -d zil-miner-switch ] || mkdir zil-miner-switch
[ ! -d zil-miner-switch ] && mkdir zil-miner-switch
cp -p crypto-zil-miner-switch-ethos/* zil-miner-switch/
cp -p crypto-zil-miner-switch-ethos/src/* zil-miner-switch/
if [ ! -e zil-miner-switch/mineropts.txt]; then
if [ ! -e zil-miner-switch/mineropts.txt ]; then
cp -p crypto-zil-miner-switch-ethos/config/mineropts.txt zil-miner-switch/
fi
if [ ! -e zil-miner-switch/minerpool.txt]; then
if [ ! -e zil-miner-switch/minerpool.txt ]; then
cp -p crypto-zil-miner-switch-ethos/config/minerpool.txt zil-miner-switch/
fi

Expand Down
24 changes: 23 additions & 1 deletion src/zil-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,29 @@ export LC_ALL=C

export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/ethos/bin:/opt/ethos/sbin"

ZILLOOP="zil-loop"

case "$-" in
*i*)
INTERACTIVE=1
;;
*)
INTERACTIVE=0
;;
esac

for pid in $(pgrep -f ${ZILLOOP}.sh); do
if [ $pid != $$ ]; then
if [ "$INTERACTIVE" == "1" ]; then
echo "[$(date)]: ${ZILLOOP}.sh process is already running with PID $pid"
screen -ls | grep "zil"
fi
exit 1
fi
done


screen -wipe 2>&1 >/dev/null

screen -dmS zil -t zil ${HOME}/zil-miner-switch/zil-loop.sh
screen -dmS zil -t zil ${HOME}/zil-miner-switch/${ZILLOOP}.sh

9 changes: 9 additions & 0 deletions src/zil-loop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ allow
while :
do

# Ensure script is not running more than once
for pid in $(pgrep -f $(basename $0)); do
status=$(ps ax | grep $pid | grep SCREEN)
if [[ -z $status ]] && [[ $pid != $$ ]]; then
echo "[$(date)]: Process is already running with PID $pid"
exit 1
fi
done

# Wait for Zilliqa ZIL PoW Time
perl ${HOME}/zil-miner-switch/zil-waitfor-pow.pl

Expand Down

0 comments on commit 4a34e23

Please sign in to comment.