Merge pull request #238 from kkoshelev/tailscale

Save tailscale state between reboots
This commit is contained in:
fewtarius 2022-06-28 06:16:57 -04:00 committed by GitHub
commit c4787f0eea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 17 deletions

View file

@ -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

View file

@ -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

View file

@ -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