Details |
Last modification |
View Log
| RSS feed
| Rev |
Author |
Line No. |
Line |
| 2 |
- |
1 |
#!/bin/bash
|
|
|
2 |
|
|
|
3 |
#Define cleanup procedure
|
|
|
4 |
cleanup() {
|
|
|
5 |
echo "Container stopped, performing cleanup..."
|
|
|
6 |
/etc/init.d/apache2 stop
|
|
|
7 |
}
|
|
|
8 |
|
|
|
9 |
#Trap SIGTERM
|
|
|
10 |
trap 'cleanup' SIGTERM
|
|
|
11 |
|
|
|
12 |
#Execute a command
|
|
|
13 |
"${@}" &
|
|
|
14 |
|
|
|
15 |
#Wait
|
|
|
16 |
wait $!
|