Skip to content
Permalink
Browse files

Create log folder before writing to it

  • Loading branch information...
NEMS Linux
NEMS Linux committed Feb 16, 2019
1 parent 04ff328 commit 243b4a08b7efd2cc95b52e3d98715dccd21ecef6
Showing with 9 additions and 4 deletions.
  1. +9 −4 nems-build.sh
@@ -16,13 +16,22 @@ if [[ $EUID -ne 0 ]]; then
exit 1
else

# Create the log folder
if [[ ! -d /var/log/nems ]]; then
mkdir /var/log/nems
fi

# Detect hardware
if [ ! -z $1 ]; then
echo $1 > /etc/.nems_hw_model_identifier
fi
wget -q -O /tmp/hw_model.sh https://raw.githubusercontent.com/Cat5TV/nems-scripts/master/hw_model.sh
chmod +x /tmp/hw_model.sh
/tmp/hw_model.sh
if [[ ! -e /var/log/nems/hw_model ]]; then
echo "Cannot run hw_model detection. Fail."
exit
fi
hw_model=$(cat /var/log/nems/hw_model | sed -n 2p)
printf "\e[97;1mDETECTED HARDWARE:\e[92;1m $hw_model\e[0m"
echo ""
@@ -70,10 +79,6 @@ if (( "$diskfree" < "8589934592" )); then
exit
fi

if [[ ! -d /var/log/nems ]]; then
mkdir /var/log/nems
fi

echo Building NEMS $ver
cd /usr/local/share/
mkdir nems

0 comments on commit 243b4a0

Please sign in to comment.
You can’t perform that action at this time.