🤬
  • Prevent overwrite of config on multiple installs.

    * Fixes #4.
    * Install now creates a docs location with the latest default example config.
    * /etc/wireguard-initramfs/config is not modified if it exists.
  • Loading...
  • Robert Pufky committed 2 years ago
    37d454d4
    1 parent 008b3fac
  • ■ ■ ■ ■ ■
    Makefile
    skipped 1 lines
    2 2   
    3 3  TARGETDIR = /etc/wireguard-initramfs
    4 4  INITRAMFS = /etc/initramfs-tools
     5 +DOCSDIR = /usr/local/share/docs/wireguard-initramfs
    5 6   
    6 7  help:
    7 8   @echo "USAGE:"
    skipped 4 lines
    12 13   @echo " make uninstall"
    13 14   @echo " Remove wireguard-initramfs from initramfs, leaves "
    14 15   @echo " $(TARGETDIR). Does not need to be installed."
     16 + @echo
     17 + @echo "Example configuration located at: $(DOCSDIR)"
    15 18   @echo
    16 19   
    17 20  .PHONY: help Makefile
    skipped 5 lines
    23 26   @mkdir -p "$(TARGETDIR)"
    24 27   @touch "$(TARGETDIR)/private_key"
    25 28   @chmod 0600 "$(TARGETDIR)/private_key"
    26  - @cp -v config "$(TARGETDIR)/config"
     29 + @cp -vn config "$(TARGETDIR)/config"
    27 30   @chmod 0644 "$(TARGETDIR)/config"
    28 31   @cp -v hooks "$(INITRAMFS)/hooks/wireguard"
    29 32   @chmod 0755 hooks "$(INITRAMFS)/hooks/wireguard"
    skipped 1 lines
    31 34   @chmod 0755 init-premount "$(INITRAMFS)/scripts/init-premount/wireguard"
    32 35   @cp -v init-bottom "$(INITRAMFS)/scripts/init-bottom/wireguard"
    33 36   @chmod 0755 init-bottom "$(INITRAMFS)/scripts/init-bottom/wireguard"
     37 + -@mkdir -p "$(DOCSDIR)/examples"
     38 + @chmod -R 0755 "$(DOCSDIR)"
     39 + @cp -v config "$(DOCSDIR)/examples/config"
     40 + @chmod 0644 "$(DOCSDIR)/examples/config"
    34 41   @echo "Done."
    35 42   @echo
    36 43   @echo "Setup $(TARGETDIR)/config and run:"
    skipped 8 lines
    45 52   @rm -f "$(INITRAMFS)/hooks/wireguard"
    46 53   @rm -f "$(INITRAMFS)/scripts/init-premount/wireguard"
    47 54   @rm -f "$(INITRAMFS)/scripts/init-bottom/wireguard"
     55 + @rm -rf "$(DOCSDIR)"
    48 56   @echo
    49 57   @echo "Done."
    50 58   
    skipped 5 lines
  • config
    Content is identical
Please wait...
Page is in error, reload to recover