Update INSTALL.sh

This commit is contained in:
Stefan Pejcic 2024-06-03 19:33:07 +02:00 committed by GitHub
parent c85727879a
commit d720828ff8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1258,6 +1258,20 @@ rm_helpers(){
}
setup_swap(){
# if ram less than 8GB, create swap
memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])
if [ -z "$(swapon -s)" ] && [ $memory -lt 8140752 ]; then
fallocate -l 1G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile none swap sw 0 0" >> /etc/fstab
fi
}
support_message() {
echo ""
echo "🎉 Welcome aboard and thank you for choosing OpenPanel! 🎉"
@ -1347,6 +1361,8 @@ main
send_install_log
setup_swap
rm_helpers
print_space_and_line