python-redfish/dmtf/redfish-setup.sh
Uggla 68f70626ad Fix mockup invalid json into http://localhost:8000/redfish/v1/Managers/1/EthernetInterfaces/1
- Update container creation process to patch the mockup.
- Also remove apache pid file if present. Happens if container is
  brutally killed.
- This is a fix for the old mockup 0.99a waiting to create a new
  process and container to use the 1.0.

Change-Id: I1be50a77b514d01e119be128b63a55180d2fa3fd
2017-01-26 13:33:34 +01:00

33 lines
821 B
Bash

#!/bin/bash
function start_apache {
[ -f "/run/apache2/apache2.pid" ] && rm -f "/run/apache2/apache2.pid"
echo "Launching apache2 in foreground with /usr/sbin/apache2ctl -DFOREGROUND -k start"
/usr/sbin/apache2ctl -DFOREGROUND -k start
}
function stop_apache {
echo "Stopping apache2"
/usr/sbin/apache2ctl stop
}
# Trap to have a clean exit
trap stop_apache HUP INT QUIT KILL TERM
# Main
[ -f /run/apache2/apache2.pid ] && rm -rf /run/apache2/apache2.pid # Avoid pb to restart container if brutally killed
cd /var/www/html
unzip -q -o /tmp/DSP2043_0.99.0a.zip
chmod 755 DSP2043_0.99.0a
ln -sf DSP2043_0.99.0a redfish
cd redfish
ln -sf . v1
cd ..
# Patch simulator to fix incorrect json
cd /
patch -p0 < /tmp/fix_manager_ei.patch
ip a
#sed -i -e 's/Listen 80/Listen 8000/' /etc/apache2/ports.conf
start_apache