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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wait_for_apt() {
|
||||||
|
while fuser /var/lib/dpkg/lock-frontend >/dev/null 2>&1; do
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
print_summary() {
|
print_summary() {
|
||||||
echo "\n==== Итоговая сводка ===="
|
echo "\n==== Итоговая сводка ===="
|
||||||
for item in "${SUMMARY[@]}"; do
|
for item in "${SUMMARY[@]}"; do
|
||||||
@@ -217,6 +223,7 @@ EOF"
|
|||||||
|
|
||||||
install_netbird() {
|
install_netbird() {
|
||||||
[[ -z "$NETBIRD_KEY" ]] && return
|
[[ -z "$NETBIRD_KEY" ]] && return
|
||||||
|
wait_for_apt
|
||||||
run "Installing Netbird" bash -c "curl -fsSL https://pkgs.netbird.io/install.sh | sh"
|
run "Installing Netbird" bash -c "curl -fsSL https://pkgs.netbird.io/install.sh | sh"
|
||||||
run "Starting Netbird" netbird up --setup-key "$NETBIRD_KEY"
|
run "Starting Netbird" netbird up --setup-key "$NETBIRD_KEY"
|
||||||
run "Checking Netbird service" systemctl is-active --quiet netbird
|
run "Checking Netbird service" systemctl is-active --quiet netbird
|
||||||
@@ -287,7 +294,6 @@ setup_role() {
|
|||||||
main() {
|
main() {
|
||||||
install_packages
|
install_packages
|
||||||
setup_timezone
|
setup_timezone
|
||||||
setup_unattended_upgrades
|
|
||||||
create_user
|
create_user
|
||||||
configure_ssh
|
configure_ssh
|
||||||
configure_ufw
|
configure_ufw
|
||||||
@@ -297,6 +303,7 @@ main() {
|
|||||||
install_netbird
|
install_netbird
|
||||||
setup_vector
|
setup_vector
|
||||||
setup_role
|
setup_role
|
||||||
|
setup_unattended_upgrades
|
||||||
}
|
}
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|||||||
Reference in New Issue
Block a user