#!/bin/bash
# -*- coding: utf-8 -*-
#
# Copyright (C) 2018 Linaro Limited
#
# Author: Senthil Kumaran S <senthil.kumaran@linaro.org>
#
# This file is part of LAVA LXC mocker.
#
# Released under the MIT License:
# http://www.opensource.org/licenses/mit-license.php
#
# Mocks lxc-info command which is used by LAVA.

while getopts "s:i:n:" opt; do
    case $opt in
        n)
            LXC_NAME="$OPTARG"
            ;;
        s)
            STATUS=1
            ;;
        i)
            IP=1
            ;;
        *)
            ;;
    esac
done

if [ "$STATUS" ]; then
    # echo running state.
    echo "'$LXC_NAME' state is RUNNING"
    exit 0
fi

if [ "$IP" ]; then
    # echo a dummy ip.
    echo "'$LXC_NAME' IP address is: '0.0.0.0'"
    exit 0
fi
