Files
OpenEuler-competition/step2/2.sh
2020-10-19 10:12:29 +08:00

20 lines
561 B
Bash

#!/bin/bash
#/bin/sbin
sh /data/workspace/myshixun/step2/wenti.sh > /root/1.log 2>&1 &
curl -s http://cip.cc|awk -F '/' '/URL/{print $4}' > /root/2.log 2>&1 &
a=$(cat /root/1.log)
b=$(cat /root/2.log)
FIND_FILE="/data/workspace/myshixun/step2/wenti.sh"
FIND_STR="ip.cip.cc"
if [ "$a" = "$b" ]
then
if [ `grep -c "$FIND_STR" $FIND_FILE` -ne '0' ];then
echo "禁止使用ip.cip.cc"
else
echo "答案正确"
fi
else
echo "答案错误"
fi