#!/bin/bash

# trap ctrl-c and call ctrl_c()
trap ctrl_c INT

function ctrl_c() {
    popd >/dev/null
    exit
}

# Check if running as root
if [[ $EUID -ne 0 ]]; then
   echo -e "Error: $0 must be run as root" 1>&2
   exit 1
fi

source /usr/bin/_posh-common
get_posh_dir

pushd "$POSH_DIR" >/dev/null

if [ "$?" -eq "0" ]; then
    python3 start.py --client "$@"
    popd > /dev/null
fi
