Update Installer.sh
Fixed errors in CLI when using sudo, now this script also updates /etc/hosts to reflect the new set Hostname Added Pi Optimizations: Reduce GPU_Mem Moved /tmp to RAM Added Log2Ram Set CPU Governer to conservative
This commit is contained in:
parent
4747be4116
commit
cc0dcfb5ba
27
Installer.sh
27
Installer.sh
@ -107,6 +107,8 @@ TERM=ansi whiptail --title "Pi Automation" --infobox "Configuring Raspberry Pi"
|
|||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
hostnamectl set-hostname $HOST
|
hostnamectl set-hostname $HOST
|
||||||
|
sed -i '/raspberrypi/d' /etc/hosts
|
||||||
|
echo "127.0.1.1 $HOST" >> /etc/hosts
|
||||||
|
|
||||||
if grep -Fxq "country=NL" /etc/wpa_supplicant/wpa_supplicant.conf
|
if grep -Fxq "country=NL" /etc/wpa_supplicant/wpa_supplicant.conf
|
||||||
then
|
then
|
||||||
@ -226,6 +228,31 @@ if [[ $OPTIONS == *"Domoticz"* ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
##-----------------##
|
||||||
|
# Optimizing Pi #
|
||||||
|
##-----------------##
|
||||||
|
|
||||||
|
echo "" >> /boot/config.txt
|
||||||
|
echo "#Reduce allocated GPU Memory since we're running headless" >> /boot/config.txt
|
||||||
|
echo "gpu_mem=16" >> /boot/config.txt
|
||||||
|
|
||||||
|
echo "" >> /etc/fstab
|
||||||
|
echo "#Mounting /tmp folder to RAM so it reduces SD Card wear" >> /etc/fstab
|
||||||
|
echo "tmpfs /tmp tmpfs defaults,noatime,nosuid 0 0" >> /etc/fstab
|
||||||
|
|
||||||
|
curl -L https://github.com/azlux/log2ram/archive/master.tar.gz -o /tmp/log2ram.tar.gz
|
||||||
|
tar zxfv /tmp/log2ram.tar.gz -C /tmp/
|
||||||
|
cd /tmp/log2ram-master/
|
||||||
|
chmod +x install.sh && sudo install.sh
|
||||||
|
cd ~
|
||||||
|
sed -i -e 's/SIZE=128M/SIZE=256M/g' /etc/log2ram.conf
|
||||||
|
sed -i -e 's/MAIL=true/MAIL=false/g' /etc/log2ram.conf
|
||||||
|
journalctl --vacuum-size=32M
|
||||||
|
systemctl restart systemd-journald
|
||||||
|
|
||||||
|
sed -i -e 's/# CPU_DEFAULT_GOVERNOR="ondemand"/CPU_DEFAULT_GOVERNOR="conservative"/g' /etc/default/cpu_governor
|
||||||
|
|
||||||
|
|
||||||
##--------------##
|
##--------------##
|
||||||
# Store Vars #
|
# Store Vars #
|
||||||
##--------------##
|
##--------------##
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user