Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 23, 2019. It is now read-only.

Commit cfb73c9

Browse files
Create gracefull-shutdown.sh
1 parent 3f41018 commit cfb73c9

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

‎gracefull-shutdown.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
3+
# list your programs here
4+
# make sure the name you put here are tested with pkill
5+
programs_list="chromium sublime_text tmux"
6+
7+
for program in $(echo $programs_list)
8+
do
9+
pkill --signal SIGTERM "$program"
10+
done
11+
for program in $(echo $programs_list)
12+
do
13+
if get-pidof.sh $program
14+
then
15+
pid=$(get-pidof.sh $program)
16+
while [ -e /proc/$pid ]
17+
do
18+
sleep 0.5
19+
done
20+
fi
21+
done
22+
rm ~/.pid/docker-compose-pid
23+
echo "$(date)" ": gracefull shutdown successful" > ~/.pid/last-shutdown-status

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /