#!/bin/bash key_id=salt if [[ $1 != "" ]] then echo -n $1 | gpg --armor --batch --homedir="/etc/salt/gpgkeys" --trust-model always --encrypt -r "${key_id}" else echo "Please specify a password" fi