Skip to content

Commit

Permalink
Add swap advice on install
Browse files Browse the repository at this point in the history
- Added advice to add swap if RAM is less than 2GB.

* Not compatible with SwapOnZRAM

Closing #53
  • Loading branch information
tmiland committed Feb 6, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 06b3e43 commit bd38938
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion invidious_update.sh
Original file line number Diff line number Diff line change
@@ -1150,15 +1150,35 @@ check_exit_status() {
}

install_invidious() {

## get total free memory size in megabytes(MB)
free=$(free -mt | grep Total | awk '{print $4}')
chk_git_repo

show_preinstall_banner

echo ""
echo "Let's go through some configuration options."
echo ""
if [[ "$free" -le 2048 ]]; then
echo -e "${ORANGE}Advice: Free memory: $free MB is less than recommended to build Invidious${NC}"
# Let the user enter swap options:
while [[ $swap_options != "y" && $swap_options != "n" ]]; do
read -p "Do you want to add swap space? [y/n]: " swap_options
done

while true; do
case $swap_options in
[Yy]* )
add_swap
break
;;
[Nn]* )
break
;;
esac
done
fi
shift
# Let the user enter advanced options:
while [[ $advanced_options != "y" && $advanced_options != "n" ]]; do
read -p "Do you want to enter advanced options? [y/n]: " advanced_options

0 comments on commit bd38938

Please sign in to comment.