mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-06-20 09:47:57 +02:00
fedora: Add persistent sudo to bootstrap.sh
Since sudo times out after 5 minutes, and since we don't want to run every command as root, we can instead create a "persistent sudo" by invoking the sudo command at least once within 5 minute time frames. This script does just that, and solves the problem of sudo timing out after a long command.
This commit is contained in:
parent
a985bf68e5
commit
a6122f8f73
@ -6,8 +6,18 @@ set -e
|
|||||||
# Change the working directory to this one
|
# Change the working directory to this one
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
# Get administrative privileges
|
||||||
|
sudo -v
|
||||||
|
|
||||||
|
# Keep pinging sudo until this script finishes
|
||||||
|
# Source: https://gist.github.com/cowboy/3118588
|
||||||
|
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
sudo dnf install -y make fedpkg
|
sudo -n dnf install -y make fedpkg
|
||||||
|
|
||||||
# Run make
|
# Run make
|
||||||
make
|
make
|
||||||
|
|
||||||
|
# Revoke privileges
|
||||||
|
sudo -K
|
||||||
|
Loading…
x
Reference in New Issue
Block a user