Save tailscale state between reboots
This commit is contained in:
parent
2e2e575528
commit
8b99615484
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() {
|
||||
mkdir -p ${INSTALL}/usr/bin/
|
||||
cp ${PKG_BUILD}/tailscale ${INSTALL}/usr/bin/
|
||||
cp ${PKG_BUILD}/tailscaled ${INSTALL}/usr/bin/
|
||||
mkdir -p ${INSTALL}/usr/sbin/
|
||||
cp ${PKG_BUILD}/tailscale ${INSTALL}/usr/sbin/
|
||||
cp ${PKG_BUILD}/tailscaled ${INSTALL}/usr/sbin/
|
||||
|
||||
mkdir -p ${INSTALL}/usr/config
|
||||
cp -R ${PKG_DIR}/config/tailscaled.defaults ${INSTALL}/usr/config
|
||||
|
|
|
@ -6,9 +6,9 @@ After=network-pre.target
|
|||
|
||||
[Service]
|
||||
EnvironmentFile=/storage/.config/tailscaled.defaults
|
||||
ExecStartPre=/usr/bin/tailscaled --cleanup
|
||||
ExecStart=/usr/bin/tailscaled --state=/var/lib/tailscale/tailscaled.state --socket=/run/tailscale/tailscaled.sock --port $PORT $FLAGS
|
||||
ExecStopPost=/usr/bin/tailscaled --cleanup
|
||||
ExecStartPre=/usr/sbin/tailscaled --cleanup
|
||||
ExecStart=/usr/sbin/tailscaled --state=/storage/.cache/tailscale/tailscaled.state --socket=/run/tailscale/tailscaled.sock --port $PORT $FLAGS
|
||||
ExecStopPost=/usr/sbin/tailscaled --cleanup
|
||||
|
||||
Restart=on-failure
|
||||
|
||||
|
|
Loading…
Reference in a new issue