Merge pull request #238 from kkoshelev/tailscale
Save tailscale state between reboots
This commit is contained in:
commit
c4787f0eea
3 changed files with 6 additions and 17 deletions
|
@ -1,11 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
# Copyright (C) 2021-present kkoshelev (https://github.com/kkoshelev)
|
|
||||||
|
|
||||||
. /etc/profile
|
|
||||||
|
|
||||||
if [ "$(get_setting tailscale.up)" == "1" ]
|
|
||||||
then
|
|
||||||
set_setting tailscale.up 0
|
|
||||||
nohup tailscale down &
|
|
||||||
fi
|
|
|
@ -16,9 +16,9 @@ pre_unpack() {
|
||||||
}
|
}
|
||||||
|
|
||||||
makeinstall_target() {
|
makeinstall_target() {
|
||||||
mkdir -p ${INSTALL}/usr/bin/
|
mkdir -p ${INSTALL}/usr/sbin/
|
||||||
cp ${PKG_BUILD}/tailscale ${INSTALL}/usr/bin/
|
cp ${PKG_BUILD}/tailscale ${INSTALL}/usr/sbin/
|
||||||
cp ${PKG_BUILD}/tailscaled ${INSTALL}/usr/bin/
|
cp ${PKG_BUILD}/tailscaled ${INSTALL}/usr/sbin/
|
||||||
|
|
||||||
mkdir -p ${INSTALL}/usr/config
|
mkdir -p ${INSTALL}/usr/config
|
||||||
cp -R ${PKG_DIR}/config/tailscaled.defaults ${INSTALL}/usr/config
|
cp -R ${PKG_DIR}/config/tailscaled.defaults ${INSTALL}/usr/config
|
||||||
|
|
|
@ -6,9 +6,9 @@ After=network-pre.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
EnvironmentFile=/storage/.config/tailscaled.defaults
|
EnvironmentFile=/storage/.config/tailscaled.defaults
|
||||||
ExecStartPre=/usr/bin/tailscaled --cleanup
|
ExecStartPre=/usr/sbin/tailscaled --cleanup
|
||||||
ExecStart=/usr/bin/tailscaled --state=/var/lib/tailscale/tailscaled.state --socket=/run/tailscale/tailscaled.sock --port $PORT $FLAGS
|
ExecStart=/usr/sbin/tailscaled --state=/storage/.cache/tailscale/tailscaled.state --socket=/run/tailscale/tailscaled.sock --port $PORT $FLAGS
|
||||||
ExecStopPost=/usr/bin/tailscaled --cleanup
|
ExecStopPost=/usr/sbin/tailscaled --cleanup
|
||||||
|
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue