github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-supply-chain-master/bin/whitelist (about)

     1  #!/bin/bash
     2  
     3  if [[ -z $1 || -z $2 ]]
     4  then
     5      echo "USAGE: $0 [user] [whitelist]"
     6      exit 1
     7  fi
     8  
     9  whitelist=$(cat $2 | grep user | sed 's#.*: \(.*$\)#\1#')
    10  for user in $whitelist
    11  do
    12      if [[ $user == $1 ]]
    13      then
    14          echo "SUCCESS: User '$1' whitelisted"
    15          exit 0
    16      fi
    17  done
    18  
    19  echo "FAILED: User '$1' not whitelisted."
    20  exit 1