GC-4552: added postinst file

This commit is contained in:
urihershgc 2015-12-07 15:10:19 +02:00
parent a87291b925
commit 75796efaea
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
#!/bin/bash
INSTALLATION_FOLDER=/var/monkey_island/installation
# install pip requirements
if [ -r $INSTALLATION_FOLDER/PACKAGE/pip_requirements.txt ]; then
sed -i 's^git.*/\(.*\).git^\1^' $INSTALLATION_FOLDER/PACKAGE/pip_requirements.txt # Use only basename for remote git pips
pip install -r $INSTALLATION_FOLDER/PACKAGE/pip_requirements.txt --no-index --find-links file://$INSTALLATION_FOLDER/installation/PACKAGE
fi
# remove installation folder
if [ -r $INSTALLATION_FOLDER ]; then
rm -rf $INSTALLATION_FOLDER/PACKAGE
rmdir --ignore-fail-on-non-empty $INSTALLATION_FOLDER
fi