summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xetc/init.d/anytun2
-rw-r--r--src/Makefile12
-rwxr-xr-xsrc/configure10
-rwxr-xr-xusr/lib/anytun-launcher (renamed from usr/bin/anytun-launcher.sh)0
-rw-r--r--usr/lib/systemd/system/anytun-control@.service2
-rw-r--r--usr/lib/systemd/system/anytun@.service2
6 files changed, 19 insertions, 9 deletions
diff --git a/etc/init.d/anytun b/etc/init.d/anytun
index 6ecfb26..eacfdcc 100755
--- a/etc/init.d/anytun
+++ b/etc/init.d/anytun
@@ -10,7 +10,7 @@
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=anytun
-LAUNCHER=/usr/local/bin/$DAEMON-launcher.sh
+LAUNCHER=/usr/local/lib/$DAEMON-launcher
DESC=secure anycast tunneling daemon
CONFIG_DIR=/usr/local/etc/$DAEMON
VARCONTROL_DIR=/var/run/$DAEMON-controld
diff --git a/src/Makefile b/src/Makefile
index 3304041..506dffa 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -295,23 +295,23 @@ install-bin: $(EXECUTABLES)
$(INSTALL) -m 755 anytun-controld $(DESTDIR)$(BINDIR)
$(INSTALL) -m 755 anytun-showtables $(DESTDIR)$(BINDIR)
@ sed -e 's#/usr/local/sbin#$(SBINDIR)#' -e 's#/usr/local/bin#$(BINDIR)#' \
- -e 's#/usr/local/etc#$(ETCDIR)#' ../usr/bin/anytun-launcher.sh > ../usr/bin/anytun-launcher.sh.bak
- $(INSTALL) -m 755 ../usr/bin/anytun-launcher.sh.bak $(DESTDIR)$(BINDIR)/anytun-launcher.sh
- rm -f ../usr/bin/anytun-launcher.sh.bak
+ -e 's#/usr/local/etc#$(ETCDIR)#' ../usr/lib/anytun-launcher > ../usr/lib/anytun-launcher.bak
+ $(INSTALL) -m 755 ../usr/lib/anytun-launcher.bak $(DESTDIR)$(BINDIR)/anytun-launcher
+ rm -f ../usr/lib/anytun-launcher.bak
install-etc:
$(INSTALL) -d $(DESTDIR)$(ETCDIR)/anytun
@ echo "example configurations can be found at $(EXAMPLESDIR)/anytun" > $(DESTDIR)$(ETCDIR)/anytun/README
$(INSTALL) -d $(DESTDIR)$(ETCDIR)/init.d
- @ sed -e 's#/usr/local/bin#$(BINDIR)#' -e 's#/usr/local/etc#$(ETCDIR)#' ../etc/init.d/anytun > ../etc/init.d/anytun.bak
+ @ sed -e 's#/usr/local/bin#$(BINDIR)#' -e 's#/usr/local/lib#$(LIBDIR)#' -e 's#/usr/local/etc#$(ETCDIR)#' ../etc/init.d/anytun > ../etc/init.d/anytun.bak
$(INSTALL) -m 755 ../etc/init.d/anytun.bak $(DESTDIR)$(ETCDIR)/init.d/anytun
rm -f ../etc/init.d/anytun.bak
install-systemd:
$(INSTALL) -d $(DESTDIR)$(SYSTEMDDIR)
$(INSTALL) -d $(DESTDIR)$(TMPFILESDDIR)
- @ sed -e 's#/usr/local/bin/#$(BINDIR)/#' ../usr/lib/systemd/system/anytun@.service > ../usr/lib/systemd/system/anytun@.service.bak
- @ sed -e 's#/usr/local/bin/#$(BINDIR)/#' ../usr/lib/systemd/system/anytun-control@.service > ../usr/lib/systemd/system/anytun-control@.service.bak
+ @ sed -e 's#/usr/local/lib/#$(LIBDIR)/#' ../usr/lib/systemd/system/anytun@.service > ../usr/lib/systemd/system/anytun@.service.bak
+ @ sed -e 's#/usr/local/lib/#$(LIBDIR)/#' ../usr/lib/systemd/system/anytun-control@.service > ../usr/lib/systemd/system/anytun-control@.service.bak
$(INSTALL) -m 644 ../usr/lib/systemd/system/anytun@.service.bak $(DESTDIR)$(SYSTEMDDIR)/anytun@.service
$(INSTALL) -m 644 ../usr/lib/systemd/system/anytun-control@.service.bak $(DESTDIR)$(SYSTEMDDIR)/anytun-control@.service
$(INSTALL) -m 644 ../usr/lib/tmpfiles.d/anytun.conf $(DESTDIR)$(TMPFILESDDIR)/anytun.conf
diff --git a/src/configure b/src/configure
index 0ba56b5..203a68c 100755
--- a/src/configure
+++ b/src/configure
@@ -59,6 +59,7 @@ ROUTING=1
PREFIX='/usr/local'
BINDIR=''
SBINDIR=''
+LIBDIR=''
ETCDIR=''
MANDIR=''
INSTALLMANPAGE=1
@@ -79,6 +80,7 @@ print_usage() {
echo " --prefix=<PREFIX> the installation prefix (default: /usr/local)"
echo " --bindir=<DIR> the path to the bin directory (default: $PREFIX/bin)"
echo " --sbindir=<DIR> the path to the sbin directory (default: $PREFIX/sbin)"
+ echo " --libdir=<DIR> the path to the lib directory (default: $PREFIX/lib)"
echo " --sysconfdir=<DIR> the path to the system configuration directory (default: $PREFIX/etc"
echo " --mandir=<DIR> the path to the system man pages (default: $PREFIX/share/man)"
echo " --no-manpage don't install manpages"
@@ -121,6 +123,9 @@ do
--sbindir=*)
SBINDIR=${arg#--sbindir=}
;;
+ --libdir=*)
+ LIBDIR=${arg#--libdir=}
+ ;;
--sysconfdir=*)
ETCDIR=${arg#--sysconfdir=}
;;
@@ -325,6 +330,10 @@ if [ -z "$SBINDIR" ]; then
SBINDIR=$PREFIX/sbin
fi
+if [ -z "$LIBDIR" ]; then
+ LIBDIR=$PREFIX/lib
+fi
+
if [ -z "$ETCDIR" ]; then
ETCDIR=$PREFIX/etc
fi
@@ -362,6 +371,7 @@ INSTALL = install
prefix := $PREFIX
BINDIR := $BINDIR
SBINDIR := $SBINDIR
+LIBDIR := $LIBDIR
ETCDIR := $ETCDIR
EOF
diff --git a/usr/bin/anytun-launcher.sh b/usr/lib/anytun-launcher
index 60773fd..60773fd 100755
--- a/usr/bin/anytun-launcher.sh
+++ b/usr/lib/anytun-launcher
diff --git a/usr/lib/systemd/system/anytun-control@.service b/usr/lib/systemd/system/anytun-control@.service
index 014dba4..e8a2289 100644
--- a/usr/lib/systemd/system/anytun-control@.service
+++ b/usr/lib/systemd/system/anytun-control@.service
@@ -7,7 +7,7 @@ Requires=anytun@%i.service
Type=simple
PIDFile=/run/anytun-controld/%i.pid
Environment="NAME=%i" "DAEMONOPTS=-D -L stdout:3 --username anytun"
-ExecStart=/usr/local/bin/anytun-launcher.sh configd
+ExecStart=/usr/local/lib/anytun-launcher configd
Restart=on-failure
PrivateTmp=yes
PrivateDevices=yes
diff --git a/usr/lib/systemd/system/anytun@.service b/usr/lib/systemd/system/anytun@.service
index aa7f32b..70fbd17 100644
--- a/usr/lib/systemd/system/anytun@.service
+++ b/usr/lib/systemd/system/anytun@.service
@@ -6,7 +6,7 @@ After=syslog.target network.target
Type=simple
PIDFile=/run/anytun/%i.pid
Environment="NAME=%i" "DAEMONOPTS=-D -L stdout:3 --username anytun"
-ExecStart=/usr/local/bin/anytun-launcher.sh vpn
+ExecStart=/usr/local/lib/anytun-launcher vpn
Restart=on-failure
PrivateTmp=yes
PrivateDevices=yes