summaryrefslogtreecommitdiff
path: root/roles/fcgiwrap/files/update_fcgiwrap
blob: a4ec9216bd2e48833b30b8e0edae606347707865 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

apk -U upgrade

fcgiwrap_pid="$(pgrep fcgiwrap | head -n 1)"
if [ -z "$fcgiwrap_pid" ]
then
  rc-service fcgiwrap restart
  exit 0
fi

fcgiwrap_proc_start_time="$(stat -Lc %Y /proc/${fcgiwrap_pid})"
fcgiwrap_file_mtime="$(stat -Lc %Y $(which fcgiwrap))"

if [ "$fcgiwrap_file_mtime" -gt "$fcgiwrap_proc_start_time" ]
then
  rc-service fcgiwrap restart
fi