forked from Atha/update-conf.d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUSAGE
122 lines (89 loc) · 3.58 KB
/
USAGE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
USAGE FILE FOR SIMPLE VERSION OF THE UPDATE-CONF.D SCRIPT
For information about the COMPLEX version refer to the man page.
INSTALLATION
============
Download it from GitHub:
git clone git://github.com/Atha/update-conf.d.git
cd update-conf.d
Run the following commands while in this directory:
1) make simple
2) make install
this will
b) copy update-conf.d to /usr/local/sbin
c) create an empty /etc/update-conf.d.conf (or touch if it should already
exist)
If you want to be safe and test the installation, add a PREFIX directory to the
Makefile, like /tmp. You can test the installation from there. Note: you can do
this as a regular user, provided you have write access to the PREFIX directory.
You need to have write access to /etc and /usr/local/sbin in order to perform an
unprefixed installation. Login as root to perform a system wide installation.
BE CAREFUL AND USE THIS SCRIPT AT YOUR OWN RISK!
UNINSTALLATION
==============
1) make uninstall
this will remove /usr/local/sbin/update-conf.d from your system
However, your configuration directories, like /etc/fstab.d, will remain! You are
encouraged to edit your files manually to maintain a suitable and working
configuration.
Also, the configuration file /etc/update-conf.d.conf will remain. You may delete
it, if it is no longer of use.
GENTOO LINUX EBUILD
===================
If you use Gentoo Linux, you might be interested in using the ebuild to perform
the installation. Just copy update-conf-9999.ebuild to your portage overlay,
say to app-admin/update-conf, then run "ebuild update-conf-9999.ebuild digest"
on it.
You can then use portage to install the script for you: "emerge update-conf"
USAGE
=====
Running "make install" will install the script and you will have to modulize the
file you want to have ".d-ed" by yourself.
Start by copying the desired file to a .d-ed directory.
This example assumes "/etc/fstab":
cd /etc
mkdir fstab.d
cp fstab fstab.d/00fstab
cd fstab.d
Now add "fstab" to your /etc/update-conf.d.conf file:
echo "fstab" >> /etc/update-conf.d.conf
You can now test-run your set-up:
update-conf.d fstab
You should see a similar output of the script:
--BEGIN-- SAMPLE OUTPUT --BEGIN--
fstab
/etc/fstab.d/fstab created, header added
Added: /etc/fstab.d/00fstab
Existing /etc/fstab renamed to /etc/fstab.d.bak
New configuration file /etc/fstab.d/fstab moved to /etc/fstab
--END-- SAMPLE OUTPUT --END--
Now it is time to modulize /etc/fstab.d/00fstab. You can have up to 100 seperate
configuration snippets for /etc/fstab, namely 00something to 99something. All
other files will be ignored. Once you have finished, remove the original
00fstab or rename it, like .00fstab or fstab-original.
To add a new <conf>.d entry, simply type:
echo <conf> >> /etc/update-conf.d.conf
or edit the file with your favorite editor.
Example:
mkdir /etc/hosts.d
cp /etc/hosts /etc/hosts.d/00hosts
echo hosts >> /etc/update-conf.d.conf
Now edit some files in /etc/hosts.d:
cd /etc/hosts.d
cp 00hosts 01loopback
cp 00hosts 02local
cp 00hosts 10wins
cp 00hosts 20apple
cp 00hosts 61vpn
cp 00hosts 99temporary
Edit these files so they only contain what the name suggests and so you don't
have any doubles.
Rename 00hosts:
mv 00hosts hosts-backup
NOTE: Filenames that don't start with two digits, like hosts-backup, will not be
processed by the script. Since all your configuration for /etc/hosts should now
be in seperate files (01loopback to 99temporary) you will have all your
configuration lines available in the resulting /etc/hosts after running the
script.
Run the script:
update-conf.d hosts
2013-03-28, Atha