28 lines
363 B
Bash
Executable File
28 lines
363 B
Bash
Executable File
#!/bin/ash
|
|
|
|
echo "Start container with parameter : $@"
|
|
|
|
trap sig_term SIGTERM
|
|
|
|
sig_term() {
|
|
echo "CATCH SIGTERM"
|
|
wait
|
|
exit 0
|
|
}
|
|
|
|
# Execute paramater.
|
|
exec "$@"
|
|
|
|
if [[ $DO_BACKUP == "true" ]]; then
|
|
exec /backup.sh
|
|
exit 0
|
|
fi
|
|
|
|
if [[ $DO_BACKUP == "restore" ]]; then
|
|
exec /restore.sh
|
|
exit 0
|
|
fi
|
|
|
|
# Infinity roop.
|
|
while : ; do sleep 1 ; done
|