Created
May 2, 2018 10:58
-
-
Save ka2n/c25c3e389ed0559ff2a7497f042c0a86 to your computer and use it in GitHub Desktop.
Get config file from antminer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -ex | |
SSH_HOST=$1 | |
MODEL_NAME=$2 | |
OUTPUT_FILE="result_$MODEL_NAME.txt" | |
REMOTE_CMD="tail -n +1 /config/* /usr/bin/compile_time" | |
if [ -n "$PASSWORD" ]; then | |
cat <<< "$PASSWORD" | |
exit 0 | |
fi | |
export PASSWORD=admin | |
export SSH_ASKPASS=$0 | |
export DISPLAY=dummy:0 | |
exec setsid \ | |
ssh \ | |
-o PreferredAuthentications=password \ | |
-o PubkeyAuthentication=no \ | |
-o StrictHostKeyChecking=no \ | |
-o UserKnownHostsFile=/dev/null \ | |
root@$SSH_HOST $REMOTE_CMD > $OUTPUT_FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment