20 lines
264 B
Bash
20 lines
264 B
Bash
|
#!/usr/bin/bash
|
||
|
|
||
|
# make sure file is present
|
||
|
file=$ENV_SHARE_FILE
|
||
|
if [[ ! -r "$file" ]]; then
|
||
|
return
|
||
|
fi
|
||
|
|
||
|
# read lines and set variables
|
||
|
IFS=' = '
|
||
|
while read line; do
|
||
|
var=${line%$IFS*}
|
||
|
value=${line#*$IFS}
|
||
|
export $var=$value
|
||
|
done <$file
|
||
|
|
||
|
# delete file
|
||
|
rm $file
|
||
|
|