#!/bin/bash
### Generic variables and functions
### -------------------------------

### Package specific variables and functions
### ----------------------------------------


key=""
if [ -f "${TRIM_PKGVAR}/key.txt" ]; then
  key=$(cat "${TRIM_PKGVAR}/key.txt")
fi

if [ -n "${wizard_username}" ]; then
	key=${wizard_username}:${wizard_password}
fi 


service_postinst ()
{
    # Save data to file
    if [ "${TRIM_APP_STATUS}" = "INSTALL" ]; then
        echo "${wizard_username}:${wizard_password}" > "${TRIM_PKGVAR}/key.txt"
    fi
}


SERVICE_COMMAND="${TRIM_APPDEST}/bin/gotty -p 12700 -w  -c ${key} login"