monkey/monkey_island/deb-package/DEBIAN/postinst

16 lines
559 B
Plaintext
Raw Normal View History

2015-12-07 21:10:19 +08:00
#!/bin/bash
INSTALLATION_FOLDER=/var/monkey_island/installation
# install pip requirements
2015-12-07 21:30:17 +08:00
if [ -r $INSTALLATION_FOLDER/pip_requirements.txt ]; then
sed -i 's^git.*/\(.*\).git^\1^' $INSTALLATION_FOLDER/pip_requirements.txt # Use only basename for remote git pips
pip install -r $INSTALLATION_FOLDER/pip_requirements.txt --no-index --find-links file://$INSTALLATION_FOLDER/installation/
2015-12-07 21:10:19 +08:00
fi
# remove installation folder
if [ -r $INSTALLATION_FOLDER ]; then
2015-12-07 21:30:17 +08:00
rm -rf $INSTALLATION_FOLDER
2015-12-07 21:10:19 +08:00
rmdir --ignore-fail-on-non-empty $INSTALLATION_FOLDER
fi