Makefile: moved backup to its own target

This commit is contained in:
celso 2024-12-13 11:27:03 -03:00
parent 0507155ef2
commit d049baf8a4
1 changed files with 3 additions and 1 deletions

View File

@ -14,9 +14,11 @@ test: makeconf
$(info checking configuration for errors and possible optimizations) $(info checking configuration for errors and possible optimizations)
nft -c -o -f $(SRC)$(NFT) nft -c -o -f $(SRC)$(NFT)
install: test backup:
$(info backing up current nftables rules) $(info backing up current nftables rules)
cp /etc/nftables.conf $(SRC)backup.conf || nft list ruleset > $(SRC)backup.conf cp /etc/nftables.conf $(SRC)backup.conf || nft list ruleset > $(SRC)backup.conf
install: test backup
$(info installing new nftables rules) $(info installing new nftables rules)
cp $(SRC)$(NFT) /etc/nftables.conf cp $(SRC)$(NFT) /etc/nftables.conf
$(info reloading nftables rules) $(info reloading nftables rules)