Added help command for the manager script.
This commit is contained in:
@@ -85,7 +85,7 @@ set_up_middleware() {
|
||||
return 1 # Error
|
||||
fi
|
||||
|
||||
print_header "Rebuild the Docker Container."
|
||||
print_header "Rebuilt the Docker Container."
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -655,9 +655,28 @@ stop() {
|
||||
fi
|
||||
}
|
||||
|
||||
usage() {
|
||||
print_header "Usage:
|
||||
>>> $0 {install|upgrade|rebuild|update_code|status|start|stop|show_config}"
|
||||
help() {
|
||||
print_header "help:
|
||||
|
||||
Source Code Management:
|
||||
install
|
||||
update_code
|
||||
upgrade
|
||||
rebuild
|
||||
|
||||
App Running:
|
||||
start
|
||||
restart
|
||||
status
|
||||
stop
|
||||
|
||||
Configurations:
|
||||
show_config
|
||||
update_config
|
||||
|
||||
Help:
|
||||
help
|
||||
"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -665,7 +684,7 @@ usage() {
|
||||
main() {
|
||||
# Check if an argument is provided
|
||||
if [[ $# -eq 0 ]]; then
|
||||
usage
|
||||
help
|
||||
fi
|
||||
|
||||
if ! load_config; then
|
||||
@@ -676,15 +695,16 @@ main() {
|
||||
case "$1" in
|
||||
install) install ;;
|
||||
update_code) update_code ;;
|
||||
rebuild) set_up_middleware;;
|
||||
upgrade) upgrade ;;
|
||||
rebuild) set_up_middleware;;
|
||||
start) start ;;
|
||||
restart) restart;;
|
||||
status) status ;;
|
||||
stop) stop ;;
|
||||
show_config) show_config ;;
|
||||
update_config) update_config;;
|
||||
stop) stop ;;
|
||||
*) echo "Invalid argument: $1"; usage ;;
|
||||
help) help;;
|
||||
*) echo "Invalid argument: $1"; help ;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@ ln -sf "$APP_DIR/scripts/manager.sh" "$HOME/.local/bin/db-middleware"
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
source ~/.bashrc
|
||||
|
||||
# sudo usermod -aG docker $USER
|
||||
# newgrp docker
|
||||
|
||||
# Run the manager.sh script with the "install" argument
|
||||
"$APP_DIR/scripts/manager.sh" install
|
||||
"$APP_DIR/scripts/manager.sh" install
|
||||
|
||||
Reference in New Issue
Block a user