root/floppyfw/files/save-config.sh

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"
11CONFIGDEVICE="/dev/fd/0"
12
13# Second: check if the config media is already mounted:
14
15# Third: mount the config media if needed
16
17mkdir /tmp/mount
18echo "Mounting $CONFIGDEVICE"
19mount -t vfat $CONFIGDEVICE /tmp/mount
20
21# Fourth; the easy part:
22cp -a /etc/config /tmp/mount/config
23cp -a /etc/network.init /tmp/mount/network.ini
24cp -a /etc/firewall.init  /tmp/mount/firewall.ini
25
26# unmount, if it wasn't mounted
Note: See TracBrowser for help on using the browser.