You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
addon-context-linux/base/etc/one-context.d/06-gen-env

26 lines
421 B

#!/bin/bash
ENV_FILE="/tmp/one_env"
TOKENTXT=$(cat /mnt/token.txt)
echo "export TOKENTXT=\"$TOKENTXT\"" > $ENV_FILE
function export_rc_vars
{
if [ -f $1 ] ; then
ONE_VARS=$(cat $1 | egrep -e '^[a-zA-Z\-\_0-9]*=' | sed 's/=.*$//')
. $1
for v in $ONE_VARS; do
echo "export $v=\"${!v}\"" >> $ENV_FILE
done
fi
}
export_rc_vars /mnt/context.sh
chown root:root $ENV_FILE
chmod a+r $ENV_FILE