mirror of
https://github.com/deadcxap/init_scripts.git
synced 2026-07-02 05:43:40 +03:00
Delay unattended upgrades and wait for apt before Netbird
This commit is contained in:
@@ -25,6 +25,12 @@ run() {
|
||||
fi
|
||||
}
|
||||
|
||||
wait_for_apt() {
|
||||
while fuser /var/lib/dpkg/lock-frontend >/dev/null 2>&1; do
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
print_summary() {
|
||||
echo "\n==== Итоговая сводка ===="
|
||||
for item in "${SUMMARY[@]}"; do
|
||||
@@ -217,6 +223,7 @@ EOF"
|
||||
|
||||
install_netbird() {
|
||||
[[ -z "$NETBIRD_KEY" ]] && return
|
||||
wait_for_apt
|
||||
run "Installing Netbird" bash -c "curl -fsSL https://pkgs.netbird.io/install.sh | sh"
|
||||
run "Starting Netbird" netbird up --setup-key "$NETBIRD_KEY"
|
||||
run "Checking Netbird service" systemctl is-active --quiet netbird
|
||||
@@ -287,7 +294,6 @@ setup_role() {
|
||||
main() {
|
||||
install_packages
|
||||
setup_timezone
|
||||
setup_unattended_upgrades
|
||||
create_user
|
||||
configure_ssh
|
||||
configure_ufw
|
||||
@@ -297,6 +303,7 @@ main() {
|
||||
install_netbird
|
||||
setup_vector
|
||||
setup_role
|
||||
setup_unattended_upgrades
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
Reference in New Issue
Block a user