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