Commit 6abb3288 authored by Olav Kvittem's avatar Olav Kvittem
Browse files

robustify error check from api

parent 0e093c60
......@@ -18,7 +18,7 @@ else # get config from server
if test -s $tmp ; then
cd $root/etc
tar xf $tmp
if test $? -gt 0 ; then
if test $? -gt 0 ; then # tar will verify format
cat $tmp
else
if test -f upgrade_software; then
......@@ -44,14 +44,14 @@ else # get config from server
if test ! -s $HOME/.ssh/rsync-key; then
curl -4 -s -o $tmp "${config_url}?variant=${variant}"\&file=rsync-key
if test -s $tmp ; then
if test -s $tmp && grep -q 'BEGIN RSA PRIVATE KEY' $tmp; then
cp $tmp $root/etc/rsync-key
chmod 600 $root/etc/rsync-key
fi
fi
curl -4 -s -o $tmp "${config_url}?variant=${variant}"\&file=mp-address.txt
if test -s $tmp ; then
if test -s $tmp && egrep -q '[0-9]+[\.:][0-9]+[\.:][0-9]+[\.:][0-9]+' $tmp; then
cp $tmp $root/etc/mp-address.txt
fi
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment