mirror of
https://github.com/srlabs/blue-merle.git
synced 2025-01-03 03:20:52 -05:00
mac-wipe: copy existing database into a volatile memory
rather than deleting everything. It seems that the device stops working when deleting the database. That is, the connection to the Internet stops working which is very safe as it does not leak any data but arguably defeats the purpose of the device.
This commit is contained in:
parent
6137fc0ea7
commit
4beae781a2
@ -2,10 +2,17 @@
|
||||
|
||||
# This script wipes all MAC address data from the device and is called upon boot
|
||||
|
||||
/etc/init.d/gl-tertf stop
|
||||
shred /etc/oui-tertf/client.db || rm -f /etc/oui-tertf/client.db
|
||||
tmpdir="$(mktemp -d)"
|
||||
# We mount a tmpfs so that the client database will be stored in memory only
|
||||
mount -t tmpfs / "$tmpdir"
|
||||
/etc/init.d/gl-tertf stop
|
||||
cp -a /etc/oui-tertf/client.db "$tmpdir"
|
||||
shred /etc/oui-tertf/client.db || rm -f /etc/oui-tertf/client.db
|
||||
|
||||
mount -t tmpfs / /etc/oui-tertf
|
||||
cp -a "$tmpdir/client.db" /etc/oui-tertf/client.db
|
||||
umount -t tmpfs -l "$tmpdir"
|
||||
|
||||
logger -p notice -t blue-merle-mac-wipe "Restarting tertf..."
|
||||
/etc/init.d/gl-tertf start
|
||||
logger -p notice -t blue-merle-mac-wipe "... Finished"
|
||||
|
Loading…
Reference in New Issue
Block a user