Skip to content

Commit

Permalink
[#1] Store hnap config file persistently on device
Browse files Browse the repository at this point in the history
  • Loading branch information
dl1com authored and chris007de committed Nov 17, 2020
1 parent 48b157d commit ee12ce2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions overlay/fw/etc/init.d/S92basestation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
# Autostart the basestation service

start() {
# Restore stored configuration
[[ -d /mnt/jffs2/root ]] && cd /mnt/jffs2/root && md5sum -s -c hnap_config.md5 && cp hnap_config.txt /root

# Check if autostart is enabled
if [ `fw_printenv -n hnap_bs_autostart` = 1 ]
then
printf "Starting basestation application"
Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions overlay/fw/root/save_hnap_config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
set +e

cat /proc/mounts | grep -q mtd2 || (echo "Filesystem not mounted use device_format_jffs2 command to setup your partition"; exit 1)

install -D /root/hnap_config.txt -t /mnt/jffs2/root
cd /root
md5sum hnap_config.txt 2>/dev/null > /mnt/jffs2/root/hnap_config.md5

0 comments on commit ee12ce2

Please sign in to comment.