Commit bd1b6fc7 authored by Tails developers's avatar Tails developers

Use flock to prevent muliple instances of Unsafe Browser.

parent 03e5f9c9
#!/bin/sh
set -e
CMD=$(basename ${0})
LOCK=/var/lock/${CMD}
. gettext.sh
TEXTDOMAIN=${CMD}
......@@ -146,6 +149,12 @@ maybe_restart_tor () {
fi
}
# Prevent multiple instances of the script.
exec 9>${LOCK}
if ! flock -x -n 9; then
error "`gettext \"Another Unsafe Browser is currently running, or being cleaned up. Please retry in a while.\"`"
fi
# Get the DNS servers that was obtained from NetworkManager, if any...
NM_ENV=/var/lib/NetworkManager/env
if [ -r "${NM_ENV}" ]; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment