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 Oct 25, 2020
1 parent 9f742e9 commit d3d15ea
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 d3d15ea

Please sign in to comment.