Skip to content

Commit

Permalink
embedded_files: freeup ram before upgrade
Browse files Browse the repository at this point in the history
freeup as much ram as possible before upgrade to cause less bricks on 32Mb RAM devices.
Initial idea for freifunk-berlin#806
  • Loading branch information
SvenRoederer committed Sep 7, 2021
1 parent e8a8d5b commit 6833738
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions embedded-files/lib/update/freifunk-berlin_freeup-ram.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
echo "This is the Freifunk Berlin-script"

MEMLIMIT=33554432 # 32MB
SERVICES="cron pingcheck uhttpd rpcd odhcpd"

MEMFREE=$(cat /proc/meminfo |grep MemTotal|awk '{print $2}')

ifdown ffuplink

echo stopping non-essential services
for service in $SERVICES; do
echo -n "${service} "
[ -x /etc/init.d/${service} ] && /etc/init.d/${service} running && { /etc/init.d/${service} stop; echo -n " ..stopped.. "; }
done
echo ""

echo flushing files from /tmp
rm >/dev/null -f /tmp/luci-indexcache*
rm >/dev/null -rf /tmp/luci-modulecache


echo end of Freifunk Berlin-script
#exit 10

0 comments on commit 6833738

Please sign in to comment.