logo

한국어
#!/bin/bash
############################################################
#
# 1~330 까지의 ONE_DEVICE.DEVID를 배열로 정의된
# 16명의 사용자 ID에 접속 권한을 일괄 추가하는 SQL 쿼리를
# 만드는 스크립트
#
############################################################
USERID[0]="kildong"
USERID[1]="i0003105"
USERID[2]="skcc5074"
USERID[3]="skcc5701"
USERID[4]="skcc5702"
USERID[5]="skcc5703"
USERID[6]="skcc5704"
USERID[7]="skcc5705"
USERID[8]="skcc5706"
USERID[9]="skcc5708"
USERID[10]="skcc5709"
USERID[11]="skcc5710"
USERID[12]="skcc5711"
USERID[13]="skcc5713"
USERID[14]="skcc5714"
USERID[15]="skcc5765"

for value in "${USERID[@]}"
do
  ii=1
  while [ ${ii} -le 330 ]
  do
    echo "INSERT INTO PASS_USER_ACCESS_LIST (USERID, DEVID, VTERMS, VTERME, RTIME, FRPASS, TELNET, SSH, FTP, SFTP, WINDOW, VNC, HTTP ) values('${value}', '${ii}', 1553475600, 4102444740, UNIX_TIMESTAMP(NOW()), 1, 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', '' );"
    ii=$(($ii+1))
  done
done