mirror of
https://github.com/frappe/frappe_docker.git
synced 2025-01-11 09:35:12 +00:00
Merge pull request #7 from carlos22/patch-1
fixing various issues with dbench
This commit is contained in:
commit
2543e54bf7
36
dbench
36
dbench
@ -1,27 +1,33 @@
|
|||||||
usage="$(basename "$0") [-h] [-c "<command to be executed inside container>"]
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
where:
|
display_usage() {
|
||||||
-h show this help text
|
echo "$(basename "$0") [-h] [-c \"<command to be executed inside container>\"]"
|
||||||
-c execute a command inside docker using docker exec"
|
echo ''
|
||||||
|
echo 'where:'
|
||||||
|
echo ' -h show this help text'
|
||||||
|
echo ' -c execute a command inside docker using docker exec'
|
||||||
|
}
|
||||||
|
|
||||||
if [[ $# -eq 0 ]]; then
|
if [[ $# -eq 0 ]]; then
|
||||||
temp="docker exec -it frappe bash"
|
docker exec -it frappe bash
|
||||||
$temp
|
|
||||||
else
|
else
|
||||||
while getopts ':hc:' option; do
|
while getopts ':hc:' option; do
|
||||||
echo $option
|
|
||||||
case "$option" in
|
case "$option" in
|
||||||
h) echo "$usage"
|
h)
|
||||||
|
display_usage
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
c) seed=$OPTARG
|
c)
|
||||||
temp="docker exec frappe bash -c 'su frappe -c \"bench $OPTARG\"; exec \"${SHELL:-sh}\"'"
|
docker exec frappe bash -c "bench $OPTARG"
|
||||||
exec="true"
|
|
||||||
;;
|
;;
|
||||||
|
\?)
|
||||||
|
echo "Invalid option: -$OPTARG" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
:)
|
||||||
|
echo "Option -$OPTARG requires an argument." >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
if [[ "$exec" == "true" ]]; then
|
|
||||||
$temp
|
|
||||||
fi
|
|
||||||
shift $((OPTIND - 1))
|
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user