Check for 600 perms and read creds from there if all fine Change-Id: I7b9b7ea210e34841da6f993bb761d48751795828changes/63/663/6
parent
ccc4ec9bcc
commit
98f7a46929
@ -0,0 +1,15 @@
|
||||
importcreds () {
|
||||
if [ -f "$CREDS" ]; then
|
||||
echo "$CREDS present, checking perms"
|
||||
set +e; stat "$CREDS" | grep 'Access: (0600' 1>/dev/null; r=$?; set -e
|
||||
if [ "$r" = "0" ]; then
|
||||
echo "$CREDS permissions ok"
|
||||
. "$CREDS"
|
||||
else
|
||||
echo "$CREDS must have permissions 600"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in new issue