]>
Commit | Line | Data |
---|---|---|
ee96ae59 | 1 | #!/bin/sh |
c29d80f3 TP |
2 | |
3 | [ -x /usr/sbin/tmpwatch ] || exit | |
4 | ||
5 | if [ -x /usr/bin/php ]; then | |
97d5d18c | 6 | RUNTIME5=$(/usr/bin/php -r '$t = round(ini_get("session.gc_maxlifetime")/3600); if ($t<1) $t=1; echo $t;' 2> /dev/null) |
ee96ae59 | 7 | elif [ -r /etc/php/php.ini ]; then |
943a825c | 8 | RUNTIME5=$(awk -F"=" '/^session.gc_maxlifetime[ \t]*=/ { t=sprintf("%d", ($2/3600)); if (t<1) { t=1; }; print t; exit;}' /etc/php/php.ini) |
ee96ae59 AM |
9 | fi |
10 | ||
c29d80f3 | 11 | if [ -x /usr/bin/php4 ]; then |
97d5d18c | 12 | RUNTIME4=$(/usr/bin/php4 -r '$t = round(ini_get("session.gc_maxlifetime")/3600); if ($t<1) $t=1; echo $t;' 2> /dev/null) |
ee96ae59 | 13 | elif [ -r /etc/php4/php.ini ]; then |
943a825c | 14 | RUNTIME4=$(awk -F"=" '/^session.gc_maxlifetime[ \t]*=/ { t=sprintf("%d", ($2/3600)); if (t<1) { t=1; }; print t; exit;}' /etc/php4/php.ini) |
ee96ae59 AM |
15 | fi |
16 | ||
17 | [ -z "$RUNTIME5" ] && RUNTIME5="1h" | |
18 | ||
19 | if [ -n "$RUNTIME5" ]; then | |
20 | /usr/sbin/tmpwatch ${RUNTIME5} /var/run/php | |
21 | fi | |
22 | ||
23 | if [ -n "$RUNTIME4" -a "$RUNTIME5" != "$RUNTIME4" ]; then | |
24 | /usr/sbin/tmpwatch ${RUNTIME4} /var/run/php | |
25 | fi |