summaryrefslogtreecommitdiff
path: root/bin/inet2.sh
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-11-17 04:01:08 +0000
committerFreya Murphy <freya@freyacat.org>2024-11-17 04:01:08 +0000
commit5e60794b428035db69899f229befac504d6dc043 (patch)
tree6135a66fcaad554b71f012f211e625f56faa787f /bin/inet2.sh
parentadd openwrt (diff)
downloadfreyanet-main.tar.gz
freyanet-main.tar.bz2
freyanet-main.zip
refactor to use any unknown prefixHEADmain
Diffstat (limited to 'bin/inet2.sh')
-rwxr-xr-xbin/inet2.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/inet2.sh b/bin/inet2.sh
index cb98c6c..00f1168 100755
--- a/bin/inet2.sh
+++ b/bin/inet2.sh
@@ -1,6 +1,6 @@
-#!/usr/bin/env sh
+#!/bin/sh
-. /var/lib/inet2/inet2.sh
+. ${INET2_PREFIX}/share/inet2/inet2.sh
runscripts() {
if [ -n "$(getval "interface $2" "$1")" ]; then
@@ -26,7 +26,7 @@ start() {
rm -fr /run/inet2/wg 2> /dev/null
mkdir -p /run/inet2/wg
- /usr/local/bin/mkbirdconfig.sh
+ ${INET2_PREFIX}/bin/mkbirdconfig.sh
step "Setting loopback addresses"
getval Loopback | while read -r addr; do
@@ -35,7 +35,7 @@ start() {
getval interface | while read -r inter; do
step "Generating config for $inter"
- run /usr/local/bin/mkwgconfig.sh "$inter" /run/inet2/wg/"$inter"
+ run ${INET2_PREFIX}/bin/mkwgconfig.sh "$inter" /run/inet2/wg/"$inter"
# create the wireguard interface *in the default namespace*
step "Adding Wireguard interface $inter"
@@ -90,7 +90,7 @@ stop() {
reload() {
getval interface | while read -r inter; do
step "Generating config for $inter"
- run /usr/local/bin/mkwgconfig.sh "$inter" /run/inet2/wg/"$inter" /etc/inet2.conf
+ run ${INET2_PREFIX}/bin/mkwgconfig.sh "$inter" /run/inet2/wg/"$inter" /etc/inet2.conf
step "Setting Wireguard config for $inter"
run wg setconf "$inter" /run/inet2/wg/"$inter"