|
Revision 1, 0.6 KB
(checked in by root, 6 years ago)
|
|
First post
|
| Line | |
|---|
| 1 | #!/bin/sh |
|---|
| 2 | |
|---|
| 3 | # This script will dump these file to whatever is the config media: |
|---|
| 4 | # (Or rather, /dev/fd/0 for now) |
|---|
| 5 | # - /etc/config |
|---|
| 6 | # - /etc/firewall.init |
|---|
| 7 | # - /etc/network.init |
|---|
| 8 | |
|---|
| 9 | # First: find the config media. |
|---|
| 10 | # CONFIGDEVICE=`echo /etc/configdevice` || "/dev/fd/0" |
|---|
| 11 | CONFIGDEVICE="/dev/fd/0" |
|---|
| 12 | |
|---|
| 13 | # Second: check if the config media is already mounted: |
|---|
| 14 | |
|---|
| 15 | # Third: mount the config media if needed |
|---|
| 16 | |
|---|
| 17 | mkdir /tmp/mount |
|---|
| 18 | echo "Mounting $CONFIGDEVICE" |
|---|
| 19 | mount -t vfat $CONFIGDEVICE /tmp/mount |
|---|
| 20 | |
|---|
| 21 | # Fourth; the easy part: |
|---|
| 22 | cp -a /etc/config /tmp/mount/config |
|---|
| 23 | cp -a /etc/network.init /tmp/mount/network.ini |
|---|
| 24 | cp -a /etc/firewall.init /tmp/mount/firewall.ini |
|---|
| 25 | |
|---|
| 26 | # unmount, if it wasn't mounted |
|---|