batch_sign_in.sh 708 字节
#! /bin/bash

echo "批量打卡"

# 待打卡的用户IC卡号列表
icList=("18860189991" "18860189992" "18860189993" "18860187878" "18860183016")
# 设备编号
device_coe='STX-D-0001'
# 测试环境服务地址
#host="http://allied-creation-manufacture-test.fjmaimaimai.com/zkteco/iclock/cdata?SN=$device_coe"
# 本地环境服务地址
host="http://106.75.231.90:9999/zkteco/iclock/cdata?SN=$device_coe"

sign_time=`date "+%Y-%m-%d 08:00:00"`

if [ $1 = 'off' ];then
  sign_time=`date "+%Y-%m-%d 18:00:00"`
  echo "下班打卡"
else
  echo "上班打卡"
fi

for str in ${icList[*]};do
  echo "IC: $str  $sign_time \r\n"
  curl --location --request POST $host \
  --data-raw "$str	$sign_time	$	YY"
done