Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1] Store hnap config file persistently on device #51

Merged
merged 1 commit into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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