-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
70-qgis.sh
executable file
·54 lines (46 loc) · 2.92 KB
/
70-qgis.sh
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# Copyright (c) 2023 b-data GmbH.
# Distributed under the terms of the MIT License.
set -e
if [ "$(id -u)" == 0 ] ; then
# Put inital QGIS settings in place
run_user_group mkdir -p "/home/$NB_USER${DOMAIN:+@$DOMAIN}/.local/share/QGIS/QGIS3/profiles/default/QGIS"
if [[ ! -f "/home/$NB_USER${DOMAIN:+@$DOMAIN}/.local/share/QGIS/QGIS3/profiles/default/QGIS/QGIS3.ini" ]]; then
run_user_group cp -a --no-preserve=ownership \
/var/backups/skel/.local/share/QGIS/QGIS3/profiles/default/QGIS/QGIS3.ini \
"/home/$NB_USER${DOMAIN:+@$DOMAIN}/.local/share/QGIS/QGIS3/profiles/default/QGIS/QGIS3.ini"
fi
run_user_group mkdir -p "/home/$NB_USER${DOMAIN:+@$DOMAIN}/.local/share/QGIS/QGIS3/profiles/default/python/plugins"
# Copy plugin 'Processing Saga NextGen Provider'
run_user_group rm -rf "/home/$NB_USER${DOMAIN:+@$DOMAIN}/.local/share/QGIS/QGIS3/profiles/default/python/plugins/processing_saga_nextgen"
run_user_group cp -a --no-preserve=ownership \
/var/backups/skel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/processing_saga_nextgen \
"/home/$NB_USER${DOMAIN:+@$DOMAIN}/.local/share/QGIS/QGIS3/profiles/default/python/plugins"
# Copy plugin 'OrfeoToolbox Provider'
if [[ ! -d "/home/$NB_USER${DOMAIN:+@$DOMAIN}/.local/share/QGIS/QGIS3/profiles/default/python/plugins/orfeoToolbox_provider" ]]; then
if [[ -d /var/backups/skel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/orfeoToolbox_provider ]]; then
run_user_group cp -a --no-preserve=ownership \
/var/backups/skel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/orfeoToolbox_provider \
"/home/$NB_USER${DOMAIN:+@$DOMAIN}/.local/share/QGIS/QGIS3/profiles/default/python/plugins"
fi
fi
else
# Put inital QGIS settings in place
mkdir -p "$HOME/.local/share/QGIS/QGIS3/profiles/default/QGIS"
if [[ ! -f "$HOME/.local/share/QGIS/QGIS3/profiles/default/QGIS/QGIS3.ini" ]]; then
cp -a /var/backups/skel/.local/share/QGIS/QGIS3/profiles/default/QGIS/QGIS3.ini \
"$HOME/.local/share/QGIS/QGIS3/profiles/default/QGIS/QGIS3.ini"
fi
mkdir -p "$HOME/.local/share/QGIS/QGIS3/profiles/default/python/plugins"
# Copy plugin 'Processing Saga NextGen Provider'
rm -rf "$HOME/.local/share/QGIS/QGIS3/profiles/default/python/plugins/processing_saga_nextgen"
cp -a /var/backups/skel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/processing_saga_nextgen \
"$HOME/.local/share/QGIS/QGIS3/profiles/default/python/plugins"
# Copy plugin 'OrfeoToolbox Provider'
if [[ ! -d "$HOME/.local/share/QGIS/QGIS3/profiles/default/python/plugins/orfeoToolbox_provider" ]]; then
if [[ -d /var/backups/skel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/orfeoToolbox_provider ]]; then
cp -a /var/backups/skel/.local/share/QGIS/QGIS3/profiles/default/python/plugins/orfeoToolbox_provider \
"$HOME/.local/share/QGIS/QGIS3/profiles/default/python/plugins"
fi
fi
fi