mirror of
https://git.disroot.org/pranav/pybatmesh.git
synced 2024-11-10 07:21:59 +05:30
many changes -- see full commit message
The config file is now installed as /etc/naxalnet/naxalnet.conf.example by default. make uninstall now does not ask for confirmation. Added rule purge in Makefile. Updated the README. Changed order of stop commands in service file. Updated setup.cfg and docstrings.
This commit is contained in:
parent
274f08cded
commit
7e0fe5ef4c
7
Makefile
7
Makefile
@ -14,9 +14,14 @@ install: build
|
||||
$(PYTHON) setup.py install --root="$(DESTDIR)" --optimize=1 --skip-build
|
||||
|
||||
uninstall:
|
||||
$(PIP) uninstall naxalnet
|
||||
$(PIP) uninstall -y naxalnet
|
||||
rm -rf /usr/share/naxalnet /usr/lib/systemd/system/naxalnet.service
|
||||
@-test -d /etc/naxalnet && echo "The directory /etc/naxalnet was not removed." && \
|
||||
echo "Do 'sudo make purge' to remove it."
|
||||
|
||||
# remove config files, like apt purge
|
||||
purge:
|
||||
rm -rf /etc/naxalnet
|
||||
|
||||
clean:
|
||||
rm -rf build naxalnet.egg-info **/__pycache__
|
||||
|
11
README.md
11
README.md
@ -202,16 +202,13 @@ sudo systemctl start NetworkManager.service
|
||||
|
||||
### Configuration
|
||||
|
||||
naxalnet stores its default configuration file in
|
||||
`/usr/share/naxalnet/naxalnet.conf`. To change how the program
|
||||
naxalnet comes with a sample configuration file
|
||||
`/etc/naxalnet/naxalnet.conf.example`. To change how the program
|
||||
behaves, copy it to /etc/naxalnet/naxalnet.conf and edit it:
|
||||
|
||||
```sh
|
||||
# Create the directory
|
||||
sudo mkdir /etc/naxalnet
|
||||
# Now copy the file
|
||||
sudo cp /usr/share/naxalnet/naxalnet.conf /etc/naxalnet
|
||||
# Edit the file with your favourite editor as root
|
||||
sudo cp /etc/naxalnet/naxalnet.conf{.example,}
|
||||
# Now edit the file with your favourite editor as root
|
||||
gedit admin:/etc/naxalnet/naxalnet.conf
|
||||
```
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
# This configuration file is part of naxalnet.
|
||||
# To configure this program, copy this file
|
||||
# to /etc/naxalnet/ (create it if it doesn't exist) and
|
||||
# edit it to your liking.
|
||||
# To configure this program, rename this file
|
||||
# to naxalnet.conf and edit it.
|
||||
# The values given here are defaults.
|
||||
|
||||
[networkd]
|
||||
# systemd-networkd configuration files bundled with naxalnet.
|
@ -29,9 +29,10 @@ ExecStart=/usr/bin/naxalnet
|
||||
ExecStartPost=/usr/bin/networkctl reload
|
||||
# Delete all files in /run/systemd/network
|
||||
ExecStop=/usr/bin/find /run/systemd/network -type f -delete
|
||||
ExecStopPost=/usr/bin/networkctl reload
|
||||
# Delete the interfaces created
|
||||
# Delete the interfaces created...
|
||||
ExecStopPost=/usr/bin/networkctl delete bridge0 bat0
|
||||
# ... and reload the configuration files.
|
||||
ExecStopPost=/usr/bin/networkctl reload
|
||||
# Make python flush messages instead of buffering.
|
||||
# When reading the systemd journal, we need to see the messages
|
||||
# in the exact order. There will suddenly be a lot of messages
|
||||
|
@ -34,6 +34,6 @@ See README.md for documentation.
|
||||
# example: 0.2.0a3.dev1 should mean 1 commit in the new
|
||||
# branch after the commit in master.
|
||||
#
|
||||
# In case you forgot to add a version, put the next number
|
||||
# in the next commit
|
||||
__version__ = "0.2.0a3.dev4"
|
||||
# In case you forgot to change the version, skip the number
|
||||
# and put the next number in the next commit.
|
||||
__version__ = "0.2.0a3.dev6"
|
||||
|
@ -18,10 +18,13 @@ following order:
|
||||
- First it reads /usr/share/naxalnet/naxalnet.conf
|
||||
and then from /usr/share/naxalnet/naxalnet.conf.d/*.conf
|
||||
where *.conf means any file with the name ending with
|
||||
.conf
|
||||
".conf". The files in this directory are intended
|
||||
to be used by distribution and package maintainers.
|
||||
- Next, it does the same with /usr/local/share/naxalnet
|
||||
- Then, it looks for the files naxalnet.conf and
|
||||
naxalnet.conf.d/*.conf from the directory
|
||||
/etc/naxalnet, like it did up above.
|
||||
/etc/naxalnet, like it did up above. This directory is where
|
||||
the user creates and stores the config file.
|
||||
- Then it parses the arguments from the commandline,
|
||||
storing the values in the files parsed until now
|
||||
as fallback. Finally you get an argpase.Namespace object
|
||||
@ -30,7 +33,7 @@ following order:
|
||||
pairs in the configuration should have an argument
|
||||
too, or they won't be parsed.
|
||||
|
||||
All the key-value pairs are replaced if they exist
|
||||
All the key-value pairs are replaced successively if they exist
|
||||
by each new configuration file parsed, similar
|
||||
to how systemd parses configuration and service files.
|
||||
If any of the files checked does not exist, then they are
|
||||
|
@ -23,4 +23,4 @@ CONFIG = {
|
||||
|
||||
# glob
|
||||
CONFIG_FILES = ["naxalnet.conf", "naxalnet.conf.d/*.conf"]
|
||||
CONFIG_DIRS = ["/usr/share/naxalnet", "/etc/naxalnet"]
|
||||
CONFIG_DIRS = ["/usr/share/naxalnet", "/usr/local/share/naxalnet", "/etc/naxalnet"]
|
||||
|
Loading…
Reference in New Issue
Block a user