Architecture and error checking.

This commit is contained in:
Jeffrey Townsend
2017-07-19 17:58:22 +00:00
parent 701b91ae82
commit cdb205ee75
2 changed files with 42 additions and 4 deletions

View File

@@ -5,9 +5,28 @@ if [ -z "$1" ]; then
exit 1
fi
ARCH=`uname -m`
case $ARCH in
armv7l|ppc)
;;
*)
echo "This script cannot be used on $ARCH platforms."
exit 1
;;
esac
PLATFORM=$(cat /etc/onl/platform)
dir=`mktemp -d`
(cd $dir && wget $1)
onlfs rw boot mv $dir/* /mnt/onl/boot/${PLATFORM}.itb
rc=
if (cd $dir && wget $1); then
onlfs rw boot mv $dir/* /mnt/onl/boot/${PLATFORM}.itb
rc=0
else
echo "Download failed."
rc=1
fi
rmdir $dir
exit $rc

View File

@@ -5,7 +5,26 @@ if [ -z "$1" ]; then
exit 1
fi
ARCH=`uname -m`
case $ARCH in
x86_64)
;;
*)
echo "This script cannot be used on $ARCH platforms."
exit 1
;;
esac
dir=`mktemp -d`
(cd $dir && wget $1)
onlfs rw boot mv $dir/* /mnt/onl/boot
rc=
if (cd $dir && wget $1); then
onlfs rw boot mv $dir/* /mnt/onl/boot
rc=0
else
echo "Download failed."
rc=1
fi
rmdir $dir
exit $rc