Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tails
tails
Commits
bd1b6fc7
Commit
bd1b6fc7
authored
Mar 27, 2012
by
Tails developers
Browse files
Use flock to prevent muliple instances of Unsafe Browser.
parent
03e5f9c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
config/chroot_local-includes/usr/local/sbin/unsafe-browser
View file @
bd1b6fc7
#!/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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment