From 75796efaea4a0ce450ff889bfcc3b54094bdaf93 Mon Sep 17 00:00:00 2001 From: urihershgc Date: Mon, 7 Dec 2015 15:10:19 +0200 Subject: [PATCH] GC-4552: added postinst file --- monkey_island/deb-package/DEBIAN/postinst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 monkey_island/deb-package/DEBIAN/postinst diff --git a/monkey_island/deb-package/DEBIAN/postinst b/monkey_island/deb-package/DEBIAN/postinst new file mode 100644 index 000000000..4c5d1c470 --- /dev/null +++ b/monkey_island/deb-package/DEBIAN/postinst @@ -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