bcae85a8e1
Change-Id: Iac361981653884cd08ed43c70f8e66a99c23dcfb
42 lines
1.4 KiB
Bash
Executable File
42 lines
1.4 KiB
Bash
Executable File
# check for service enabled
|
|
if is_service_enabled {{cookiecutter.service}}; then
|
|
if [[ "$1" == "source" ]]; then
|
|
# Initial source of lib script
|
|
source $(dirname "$0")/lib/{{cookiecutter.service}}
|
|
fi
|
|
|
|
if [[ "$1" == "stack" && "$2" == "pre-install" ]]; then
|
|
# Set up system services
|
|
echo_summary "Configuring system services {{cookiecutter.service}}"
|
|
pre_install_{{cookiecutter.service}}
|
|
|
|
elif [[ "$1" == "stack" && "$2" == "install" ]]; then
|
|
# Perform installation of service source
|
|
echo_summary "Installing {{cookiecutter.service}}"
|
|
install_{{cookiecutter.service}}
|
|
|
|
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
|
|
# Configure after the other layer 1 and 2 services have been configured
|
|
echo_summary "Configuring {{cookiecutter.service}}"
|
|
configure_{{cookiecutter.service}}
|
|
|
|
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
|
|
# Initialize and start the {{cookiecutter.service}} service
|
|
echo_summary "Initializing {{cookiecutter.service}}"
|
|
init_{{cookiecutter.service}}
|
|
fi
|
|
|
|
if [[ "$1" == "unstack" ]]; then
|
|
# Shut down {{cookiecutter.service}} services
|
|
# no-op
|
|
shutdown_{{cookiecutter.service}}
|
|
fi
|
|
|
|
if [[ "$1" == "clean" ]]; then
|
|
# Remove state and transient data
|
|
# Remember clean.sh first calls unstack.sh
|
|
# no-op
|
|
cleanup_{{cookiecutter.service}}
|
|
fi
|
|
fi
|