diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2019-03-01 20:22:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-01 20:22:22 +0100 |
commit | 1e9c710fdd632c1448f75bfa2c29f1483e598d53 (patch) | |
tree | b798f807a2eb1a992ae4a230bb3890fecbced2d7 | |
parent | d5154ee2ae4f5cdf0a2ee8ea02bd696a6a95171d (diff) | |
parent | c01bda038e84156ffcd8cdc21025e7f3f3892fcf (diff) | |
download | wallabag-1e9c710fdd632c1448f75bfa2c29f1483e598d53.tar.gz wallabag-1e9c710fdd632c1448f75bfa2c29f1483e598d53.tar.zst wallabag-1e9c710fdd632c1448f75bfa2c29f1483e598d53.zip |
Merge pull request #3885 from mart-e/script-ignore-root
Allow optional --ignore-root-warning
-rwxr-xr-x | scripts/install.sh | 15 | ||||
-rwxr-xr-x | scripts/update.sh | 16 |
2 files changed, 22 insertions, 9 deletions
diff --git a/scripts/install.sh b/scripts/install.sh index 8b7ea03f..de1fb8f6 100755 --- a/scripts/install.sh +++ b/scripts/install.sh | |||
@@ -5,9 +5,17 @@ | |||
5 | IGNORE_ROOT_ARG="--ignore-root-warning" | 5 | IGNORE_ROOT_ARG="--ignore-root-warning" |
6 | IGNORE_ROOT=0 | 6 | IGNORE_ROOT=0 |
7 | 7 | ||
8 | if [ "$1" == "$IGNORE_ROOT_ARG" ]; then | 8 | while :; do |
9 | IGNORE_ROOT=1 | 9 | case $1 in |
10 | fi | 10 | $IGNORE_ROOT_ARG) IGNORE_ROOT=1 |
11 | ;; | ||
12 | *[a-zA-Z]) ENV=$1 | ||
13 | ;; | ||
14 | *) break | ||
15 | ;; | ||
16 | esac | ||
17 | shift | ||
18 | done | ||
11 | 19 | ||
12 | # Abort running this script if root | 20 | # Abort running this script if root |
13 | if [ "$IGNORE_ROOT" -eq 0 ] && [ "$EUID" == "0" ]; then | 21 | if [ "$IGNORE_ROOT" -eq 0 ] && [ "$EUID" == "0" ]; then |
@@ -22,7 +30,6 @@ DIR="${BASH_SOURCE}" | |||
22 | if [ ! -d "$DIR" ]; then DIR="$PWD/scripts"; fi | 30 | if [ ! -d "$DIR" ]; then DIR="$PWD/scripts"; fi |
23 | . "$DIR/require.sh" | 31 | . "$DIR/require.sh" |
24 | 32 | ||
25 | ENV=$1 | ||
26 | TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) | 33 | TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) |
27 | 34 | ||
28 | git checkout $TAG | 35 | git checkout $TAG |
diff --git a/scripts/update.sh b/scripts/update.sh index c62d104a..e86a76db 100755 --- a/scripts/update.sh +++ b/scripts/update.sh | |||
@@ -5,9 +5,17 @@ | |||
5 | IGNORE_ROOT_ARG="--ignore-root-warning" | 5 | IGNORE_ROOT_ARG="--ignore-root-warning" |
6 | IGNORE_ROOT=0 | 6 | IGNORE_ROOT=0 |
7 | 7 | ||
8 | if [ "$1" == "$IGNORE_ROOT_ARG" ]; then | 8 | while :; do |
9 | IGNORE_ROOT=1 | 9 | case $1 in |
10 | fi | 10 | $IGNORE_ROOT_ARG) IGNORE_ROOT=1 |
11 | ;; | ||
12 | *[a-zA-Z]) ENV=$1 | ||
13 | ;; | ||
14 | *) break | ||
15 | ;; | ||
16 | esac | ||
17 | shift | ||
18 | done | ||
11 | 19 | ||
12 | # Abort running this script if root | 20 | # Abort running this script if root |
13 | if [ "$IGNORE_ROOT" -eq 0 ] && [ "$EUID" == "0" ]; then | 21 | if [ "$IGNORE_ROOT" -eq 0 ] && [ "$EUID" == "0" ]; then |
@@ -25,8 +33,6 @@ DIR="${BASH_SOURCE}" | |||
25 | if [ ! -d "$DIR" ]; then DIR="$PWD/scripts"; fi | 33 | if [ ! -d "$DIR" ]; then DIR="$PWD/scripts"; fi |
26 | . "$DIR/require.sh" | 34 | . "$DIR/require.sh" |
27 | 35 | ||
28 | ENV=$1 | ||
29 | |||
30 | rm -rf var/cache/* | 36 | rm -rf var/cache/* |
31 | git fetch origin | 37 | git fetch origin |
32 | git fetch --tags | 38 | git fetch --tags |