monkey/monkey_island/deb-package/DEBIAN/postinst

22 lines
574 B
Plaintext
Raw Normal View History

2015-12-07 21:10:19 +08:00
#!/bin/bash
2015-12-07 22:11:31 +08:00
MONKEY_FOLDER=/var/monkey_island
2015-12-07 21:10:19 +08:00
INSTALLATION_FOLDER=/var/monkey_island/installation
2016-01-19 23:10:12 +08:00
cp -f ${MONKEY_FOLDER}/linux/monkey.sh /usr/bin/monkey
2016-01-19 22:07:02 +08:00
chmod 755 /usr/bin/monkey
2015-12-07 21:10:19 +08:00
# install pip requirements
2015-12-07 22:11:31 +08:00
pip install -r $MONKEY_FOLDER/pip_requirements.txt --no-index --find-links file://$INSTALLATION_FOLDER
2015-12-07 21:10:19 +08:00
2015-12-07 22:11:31 +08:00
# remove installation folder and unnecessary files
2016-01-19 22:07:02 +08:00
rm -rf ${INSTALLATION_FOLDER}
rm -f ${MONKEY_FOLDER}/pip_requirements.txt
2015-12-07 22:11:31 +08:00
2016-01-19 22:07:02 +08:00
mv ${MONKEY_FOLDER}/ubuntu/* /etc/init/
2015-12-07 22:11:31 +08:00
2016-01-19 22:07:02 +08:00
${MONKEY_FOLDER}/create_certificate.sh
2015-12-07 22:11:31 +08:00
service monkey-island start
service monkey-mongo start