mirror of
https://github.com/amnezia-vpn/amneziawg-tools.git
synced 2025-08-02 17:42:50 +02:00
Prepare packaging
This commit is contained in:
parent
eec604dc95
commit
dc3a0e73e1
4 changed files with 17 additions and 17 deletions
12
src/Makefile
12
src/Makefile
|
@ -92,16 +92,16 @@ clean:
|
|||
$(RM) wg *.o *.d $(wildcard wincompat/*.o wincompat/*.lib wincompat/*.dll)
|
||||
|
||||
install: wg
|
||||
@install -v -d "$(DESTDIR)$(BINDIR)" && install -v -m 0755 wg "$(DESTDIR)$(BINDIR)/wg"
|
||||
@install -v -d "$(DESTDIR)$(MANDIR)/man8" && install -v -m 0644 man/wg.8 "$(DESTDIR)$(MANDIR)/man8/wg.8"
|
||||
@install -v -d "$(DESTDIR)$(BINDIR)" && install -v -m 0755 wg "$(DESTDIR)$(BINDIR)/awg"
|
||||
@install -v -d "$(DESTDIR)$(MANDIR)/man8" && install -v -m 0644 man/wg.8 "$(DESTDIR)$(MANDIR)/man8/awg.8"
|
||||
@[ "$(WITH_BASHCOMPLETION)" = "yes" ] || exit 0; \
|
||||
install -v -d "$(DESTDIR)$(BASHCOMPDIR)" && install -v -m 0644 completion/wg.bash-completion "$(DESTDIR)$(BASHCOMPDIR)/wg"
|
||||
install -v -d "$(DESTDIR)$(BASHCOMPDIR)" && install -v -m 0644 completion/wg.bash-completion "$(DESTDIR)$(BASHCOMPDIR)/awg"
|
||||
@[ "$(WITH_WGQUICK)" = "yes" ] || exit 0; \
|
||||
install -v -m 0755 wg-quick/$(PLATFORM).bash "$(DESTDIR)$(BINDIR)/wg-quick" && install -v -m 0700 -d "$(DESTDIR)$(SYSCONFDIR)/wireguard"
|
||||
install -v -m 0755 wg-quick/$(PLATFORM).bash "$(DESTDIR)$(BINDIR)/awg-quick" && install -v -m 0700 -d "$(DESTDIR)$(SYSCONFDIR)/amnezia"
|
||||
@[ "$(WITH_WGQUICK)" = "yes" ] || exit 0; \
|
||||
install -v -m 0644 man/wg-quick.8 "$(DESTDIR)$(MANDIR)/man8/wg-quick.8"
|
||||
install -v -m 0644 man/wg-quick.8 "$(DESTDIR)$(MANDIR)/man8/awg-quick.8"
|
||||
@[ "$(WITH_WGQUICK)" = "yes" -a "$(WITH_BASHCOMPLETION)" = "yes" ] || exit 0; \
|
||||
install -v -m 0644 completion/wg-quick.bash-completion "$(DESTDIR)$(BASHCOMPDIR)/wg-quick"
|
||||
install -v -m 0644 completion/wg-quick.bash-completion "$(DESTDIR)$(BASHCOMPDIR)/awg-quick"
|
||||
@[ "$(WITH_WGQUICK)" = "yes" -a "$(WITH_SYSTEMDUNITS)" = "yes" ] || exit 0; \
|
||||
install -v -d "$(DESTDIR)$(SYSTEMDUNITDIR)" && install -v -m 0644 systemd/* "$(DESTDIR)$(SYSTEMDUNITDIR)/"
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
Description=WireGuard via wg-quick(8) for %I
|
||||
After=network-online.target nss-lookup.target
|
||||
Wants=network-online.target nss-lookup.target
|
||||
PartOf=wg-quick.target
|
||||
Documentation=man:wg-quick(8)
|
||||
Documentation=man:wg(8)
|
||||
PartOf=awg-quick.target
|
||||
Documentation=man:awg-quick(8)
|
||||
Documentation=man:awg(8)
|
||||
Documentation=https://www.wireguard.com/
|
||||
Documentation=https://www.wireguard.com/quickstart/
|
||||
Documentation=https://git.zx2c4.com/wireguard-tools/about/src/man/wg-quick.8
|
||||
|
@ -13,9 +13,9 @@ Documentation=https://git.zx2c4.com/wireguard-tools/about/src/man/wg.8
|
|||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/usr/bin/wg-quick up %i
|
||||
ExecStop=/usr/bin/wg-quick down %i
|
||||
ExecReload=/bin/bash -c 'exec /usr/bin/wg syncconf %i <(exec /usr/bin/wg-quick strip %i)'
|
||||
ExecStart=/usr/bin/awg-quick up %i
|
||||
ExecStop=/usr/bin/awg-quick down %i
|
||||
ExecReload=/bin/bash -c 'exec /usr/bin/awg syncconf %i <(exec /usr/bin/awg-quick strip %i)'
|
||||
Environment=WG_ENDPOINT_RESOLUTION_RETRIES=infinity
|
||||
|
||||
[Install]
|
|
@ -199,7 +199,7 @@ remove_firewall() {
|
|||
for iptables in iptables ip6tables; do
|
||||
restore="" found=0
|
||||
while read -r line; do
|
||||
[[ $line == "*"* || $line == COMMIT || $line == "-A "*"-m comment --comment \"wg-quick(8) rule for $INTERFACE\""* ]] || continue
|
||||
[[ $line == "*"* || $line == COMMIT || $line == "-A "*"-m comment --comment \"awg-quick(8) rule for $INTERFACE\""* ]] || continue
|
||||
[[ $line == "-A"* ]] && found=1
|
||||
printf -v restore '%s%s\n' "$restore" "${line/#-A/-D}"
|
||||
done < <($iptables-save 2>/dev/null)
|
||||
|
@ -224,7 +224,7 @@ add_default() {
|
|||
cmd ip $proto rule add table main suppress_prefixlength 0
|
||||
cmd ip $proto route add "$1" dev "$INTERFACE" table $table
|
||||
|
||||
local marker="-m comment --comment \"wg-quick(8) rule for $INTERFACE\"" restore=$'*raw\n' nftable="wg-quick-$INTERFACE" nftcmd
|
||||
local marker="-m comment --comment \"awg-quick(8) rule for $INTERFACE\"" restore=$'*raw\n' nftable="wg-quick-$INTERFACE" nftcmd
|
||||
printf -v nftcmd '%sadd table %s %s\n' "$nftcmd" "$pf" "$nftable"
|
||||
printf -v nftcmd '%sadd chain %s %s preraw { type filter hook prerouting priority -300; }\n' "$nftcmd" "$pf" "$nftable"
|
||||
printf -v nftcmd '%sadd chain %s %s premangle { type filter hook prerouting priority -150; }\n' "$nftcmd" "$pf" "$nftable"
|
||||
|
@ -248,7 +248,7 @@ add_default() {
|
|||
}
|
||||
|
||||
set_config() {
|
||||
cmd wg setconf "$INTERFACE" <(echo "$WG_CONFIG")
|
||||
cmd awg setconf "$INTERFACE" <(echo "$WG_CONFIG")
|
||||
}
|
||||
|
||||
save_config() {
|
||||
|
@ -343,7 +343,7 @@ cmd_up() {
|
|||
}
|
||||
|
||||
cmd_down() {
|
||||
[[ " $(wg show interfaces) " == *" $INTERFACE "* ]] || die "\`$INTERFACE' is not a WireGuard interface"
|
||||
[[ " $(awg show interfaces) " == *" $INTERFACE "* ]] || die "\`$INTERFACE' is not a WireGuard interface"
|
||||
execute_hooks "${PRE_DOWN[@]}"
|
||||
[[ $SAVE_CONFIG -eq 0 ]] || save_config
|
||||
del_if
|
||||
|
@ -353,7 +353,7 @@ cmd_down() {
|
|||
}
|
||||
|
||||
cmd_save() {
|
||||
[[ " $(wg show interfaces) " == *" $INTERFACE "* ]] || die "\`$INTERFACE' is not a WireGuard interface"
|
||||
[[ " $(awg show interfaces) " == *" $INTERFACE "* ]] || die "\`$INTERFACE' is not a WireGuard interface"
|
||||
save_config
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue