Skip to content
Snippets Groups Projects
Unverified Commit 69e5bf53 authored by tamaina's avatar tamaina Committed by GitHub
Browse files

Update ubuntu.sh

parent 87fb8963
No related branches found
No related tags found
No related merge requests found
......@@ -43,24 +43,24 @@ mem_all=`free -t --si -g | tail -n 1`;
mem_allarr=(${mem_all//\\t/ });
if [ ${mem_allarr[1]} -ge 2 ]; then
tput setaf 7;
echo " OK. This computer has ${mem_allarr[1]}GB RAM.";
tput setaf 7;
echo " OK. This computer has ${mem_allarr[1]}GB RAM.";
else
tput setaf 1;
echo " NG. This computer doesn't have enough RAM (>= 2GB, Current ${mem_allarr[1]}GB).";
tput setaf 7;
mem_swap=`free | tail -n 1`;
mem_swaparr=(${mem_swap//\\t/ });
if [ ${mem_swaparr[1]} -eq 0 ]; then
echo " Swap will be made (1M x 1536).";
dd if=/dev/zero of=/swap bs=1M count=1536;
mkswap /swap;
swapon /swap;
echo "/swapfile none swap sw 0" >> /etc/fstab;
free -t;
tput setaf 1;
echo " NG. This computer doesn't have enough RAM (>= 2GB, Current ${mem_allarr[1]}GB).";
tput setaf 7;
mem_swap=`free | tail -n 1`;
mem_swaparr=(${mem_swap//\\t/ });
if [ ${mem_swaparr[1]} -eq 0 ]; then
echo " Swap will be made (1M x 1536).";
dd if=/dev/zero of=/swap bs=1M count=1536;
mkswap /swap;
swapon /swap;
echo "/swapfile none swap sw 0" >> /etc/fstab;
free -t;
else
echo " Add more swaps!";
exit 1;
echo " Add more swaps!";
exit 1;
fi
fi
#endregion
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment