Skip to content

Commit 86712ba

Browse files
committed
copy ispconfig_update.sh to a temp file to run
1 parent 269b2ce commit 86712ba

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

server/scripts/ispconfig_update.sh

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,25 @@ _UPD=1
1515
{
1616
if [ -n "${_UPD}" ]
1717
then
18-
exec php -q \
19-
-d disable_classes= \
20-
-d disable_functions= \
21-
-d open_basedir= \
22-
/usr/local/ispconfig/server/scripts/ispconfig_update.php
18+
n=$(readlink -f ${0})
19+
if [ "$(basename ${0})" == "ispconfig_update.sh" ]
20+
then
21+
cp -p ${n} ${n}.exec
22+
chmod +x ${n}.exec
23+
exec ${n}.exec
24+
else
25+
# clean up tmp .exec file
26+
if [ "$(basename ${0})" == "ispconfig_update.sh.exec" ]; then
27+
rm -f ${0}
28+
fi
29+
30+
exec php -q \
31+
-d disable_classes= \
32+
-d disable_functions= \
33+
-d open_basedir= \
34+
/usr/local/ispconfig/server/scripts/ispconfig_update.php
35+
36+
fi
2337
fi
2438
}
2539

0 commit comments

Comments
 (0)