forked from freedomofpress/securedrop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsecuredrop-admin
More file actions
executable file
·26 lines (26 loc) · 817 Bytes
/
securedrop-admin
File metadata and controls
executable file
·26 lines (26 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# shellcheck disable=SC1090
# this is for backward compatibility and also because it
# is more convenient for the admin to have the script at
# the top level of the SecureDrop repository
d=$(dirname "$0")
if test "$1" = "setup" || test "$2" = "setup"; then
# the .venv symlink is to not confuse devs used to
# finding the directory at the top-level, prior to 0.6
rm -fr "$d/.venv"
ln -s "$d/admin/.venv" "$d/.venv"
if test "$1" = "setup"; then
shift
exec python "$d/admin/bootstrap.py" "$@"
else
exec python "$d/admin/bootstrap.py" "$1"
fi
else
activate="$d/admin/.venv/bin/activate"
if test -f "$activate" ; then
source "$activate"
exec "$d/admin/.venv/bin/securedrop-admin" --root "$d" "$@"
else
echo "please run '$0 setup' first"
fi
fi