2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-11-08 14:21:05 +00:00
frappe_docker/dbench

28 lines
617 B
Plaintext
Executable File

usage="$(basename "$0") [-h] [-c "<command to be executed inside container>"]
where:
-h show this help text
-c execute a command inside docker using docker exec"
if [[ $# -eq 0 ]]; then
temp="docker exec -it frappe bash"
$temp
else
while getopts ':hc:' option; do
echo $option
case "$option" in
h) echo "$usage"
exit
;;
c) seed=$OPTARG
temp="docker exec frappe bash -c 'su frappe -c \"bench $OPTARG\"; exec \"${SHELL:-sh}\"'"
exec="true"
;;
esac
done
if [[ "$exec" == "true" ]]; then
$temp
fi
shift $((OPTIND - 1))
fi