mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 02:28:05 -07:00
improved ioncube package specs
This commit is contained in:
parent
3fbd3014c7
commit
3615b38fbf
6 changed files with 54 additions and 8 deletions
|
@ -1,8 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Run triggers only on updates
|
||||
if [ -e /usr/local/vesta/ioncube/add_ioncube.sh ]; then
|
||||
/usr/local/vesta/ioncube/add_ioncube.sh
|
||||
if [ -e /usr/local/vesta/ioncube/ioncube.sh ]; then
|
||||
/usr/local/vesta/ioncube/ioncube.sh add
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
|
8
src/deb/ioncube/prerm
Executable file
8
src/deb/ioncube/prerm
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Run triggers only on updates
|
||||
if [ -e /usr/local/vesta/ioncube/ioncube.sh ]; then
|
||||
/usr/local/vesta/ioncube/ioncube.sh delete
|
||||
fi
|
||||
|
||||
exit 0
|
8
src/deb/php/postinst
Executable file
8
src/deb/php/postinst
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Run triggers only on updates
|
||||
if [ -e /usr/local/vesta/ioncube/ioncube.sh ]; then
|
||||
/usr/local/vesta/ioncube/ioncube.sh add
|
||||
fi
|
||||
|
||||
exit 0
|
|
@ -1,13 +1,28 @@
|
|||
#!/bin/bash
|
||||
|
||||
action=${1-add}
|
||||
VESTA='/usr/local/vesta'
|
||||
ioncube="ioncube_loader_lin_5.6.so"
|
||||
php='/usr/local/vesta/php/lib/php.ini'
|
||||
|
||||
# Check if extention is enabled
|
||||
if [ -z "$(grep $ioncube $php |grep -v ';')" ]; then
|
||||
echo "zend_extension = '$VESTA/ioncube/$ioncube'" >> $php
|
||||
/etc/init.d/vesta restart
|
||||
if [ ! -e "$php" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ ! -e "$VESTA/ioncube/$ioncube" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ "$action" = 'install' ]; then
|
||||
if [ -z "$(grep $ioncube $php |grep -v ';')" ]; then
|
||||
echo "zend_extension = '$VESTA/ioncube/$ioncube'" >> $php
|
||||
/etc/init.d/vesta restart
|
||||
fi
|
||||
else
|
||||
if [ ! -z "$(grep $ioncube $php |grep -v ';')" ]; then
|
||||
sed -i "/$ioncube/d" $php
|
||||
/etc/init.d/vesta restart
|
||||
fi
|
||||
fi
|
||||
|
||||
exit
|
||||
|
|
|
@ -30,10 +30,18 @@ rm -rf %{buildroot}
|
|||
|
||||
%post
|
||||
if [ $1 -eq 1 ]; then
|
||||
if [ -e /usr/local/vesta/ioncube/add_ioncube.sh ]; then
|
||||
/usr/local/vesta/ioncube/add_ioncube.sh
|
||||
if [ -e /usr/local/vesta/ioncube/ioncube.sh ]; then
|
||||
/usr/local/vesta/ioncube/ioncube.sh add
|
||||
fi
|
||||
fi
|
||||
|
||||
%preun
|
||||
if [ $1 -eq 0 ]; then
|
||||
if [ -e /usr/local/vesta/ioncube/ioncube.sh ]; then
|
||||
/usr/local/vesta/ioncube/ioncube.sh delete
|
||||
fi
|
||||
fi
|
||||
|
||||
%files
|
||||
%{_vestadir}
|
||||
|
||||
|
|
|
@ -40,6 +40,13 @@ rm -rf $RPM_BUILD_ROOT/.lock
|
|||
%clean
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%post
|
||||
if [ $1 -eq 1 ]; then
|
||||
if [ -e /usr/local/vesta/ioncube/ioncube.sh ]; then
|
||||
/usr/local/vesta/ioncube/ioncube.sh add
|
||||
fi
|
||||
fi
|
||||
|
||||
%postun
|
||||
if [ $1 -ge 1 ]; then
|
||||
if [ -e "/var/run/vesta-php.pid" ]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue