add-site 302 B

12345678910
  1. #!/bin/bash
  2. if [[ "$1" != "" ]] && [[ "$2" != "" ]]; then
  3. read -s -p "Password:" pass;
  4. file=`dirname $BASH_SOURCE`/../etc/sites.d/$2;
  5. touch $file;
  6. echo "sites+=([username]=\"$1\" [host]=\"$2\" [password]=\"$pass\")" > $file;
  7. echo "Site $2 created";
  8. else
  9. echo "Usage: $0 <username> <hostname>"
  10. fi;