Skip to content

Commit 3615b38

Browse files
author
Serghey Rodin
committed
improved ioncube package specs
1 parent 3fbd301 commit 3615b38

File tree

6 files changed

+54
-8
lines changed

6 files changed

+54
-8
lines changed

src/deb/ioncube/postinst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22

33
# Run triggers only on updates
4-
if [ -e /usr/local/vesta/ioncube/add_ioncube.sh ]; then
5-
/usr/local/vesta/ioncube/add_ioncube.sh
4+
if [ -e /usr/local/vesta/ioncube/ioncube.sh ]; then
5+
/usr/local/vesta/ioncube/ioncube.sh add
66
fi
77

88
exit 0

src/deb/ioncube/prerm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# Run triggers only on updates
4+
if [ -e /usr/local/vesta/ioncube/ioncube.sh ]; then
5+
/usr/local/vesta/ioncube/ioncube.sh delete
6+
fi
7+
8+
exit 0

src/deb/php/postinst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# Run triggers only on updates
4+
if [ -e /usr/local/vesta/ioncube/ioncube.sh ]; then
5+
/usr/local/vesta/ioncube/ioncube.sh add
6+
fi
7+
8+
exit 0

src/rpm/conf/ioncube.sh

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,28 @@
11
#!/bin/bash
22

3+
action=${1-add}
34
VESTA='/usr/local/vesta'
45
ioncube="ioncube_loader_lin_5.6.so"
56
php='/usr/local/vesta/php/lib/php.ini'
67

7-
# Check if extention is enabled
8-
if [ -z "$(grep $ioncube $php |grep -v ';')" ]; then
9-
echo "zend_extension = '$VESTA/ioncube/$ioncube'" >> $php
10-
/etc/init.d/vesta restart
8+
if [ ! -e "$php" ]; then
9+
exit
10+
fi
11+
12+
if [ ! -e "$VESTA/ioncube/$ioncube" ]; then
13+
exit
14+
fi
15+
16+
if [ "$action" = 'install' ]; then
17+
if [ -z "$(grep $ioncube $php |grep -v ';')" ]; then
18+
echo "zend_extension = '$VESTA/ioncube/$ioncube'" >> $php
19+
/etc/init.d/vesta restart
20+
fi
21+
else
22+
if [ ! -z "$(grep $ioncube $php |grep -v ';')" ]; then
23+
sed -i "/$ioncube/d" $php
24+
/etc/init.d/vesta restart
25+
fi
1126
fi
1227

1328
exit

src/rpm/specs/vesta-ioncube.spec

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,18 @@ rm -rf %{buildroot}
3030

3131
%post
3232
if [ $1 -eq 1 ]; then
33-
if [ -e /usr/local/vesta/ioncube/add_ioncube.sh ]; then
34-
/usr/local/vesta/ioncube/add_ioncube.sh
33+
if [ -e /usr/local/vesta/ioncube/ioncube.sh ]; then
34+
/usr/local/vesta/ioncube/ioncube.sh add
3535
fi
3636
fi
37+
38+
%preun
39+
if [ $1 -eq 0 ]; then
40+
if [ -e /usr/local/vesta/ioncube/ioncube.sh ]; then
41+
/usr/local/vesta/ioncube/ioncube.sh delete
42+
fi
43+
fi
44+
3745
%files
3846
%{_vestadir}
3947

src/rpm/specs/vesta-php.spec

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ rm -rf $RPM_BUILD_ROOT/.lock
4040
%clean
4141
rm -rf %{buildroot}
4242

43+
%post
44+
if [ $1 -eq 1 ]; then
45+
if [ -e /usr/local/vesta/ioncube/ioncube.sh ]; then
46+
/usr/local/vesta/ioncube/ioncube.sh add
47+
fi
48+
fi
49+
4350
%postun
4451
if [ $1 -ge 1 ]; then
4552
if [ -e "/var/run/vesta-php.pid" ]; then

0 commit comments

Comments
 (0)