aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-09-16 16:23:09 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-09-16 16:23:09 -0300
commit6d50a4f602289d213367d0499e9cba9850e9e5c2 (patch)
tree7164fe781047e8ae11de53937552dbc45ed1d6ca
parente82704e009f66be5eeceb03b012ef0a719127a5b (diff)
downloadapps-6d50a4f602289d213367d0499e9cba9850e9e5c2.tar.gz
apps-6d50a4f602289d213367d0499e9cba9850e9e5c2.tar.bz2
Handle also custom firejail profiles att firejail-refresh-links
-rwxr-xr-xfirejail/firejail-refresh-links25
1 files changed, 19 insertions, 6 deletions
diff --git a/firejail/firejail-refresh-links b/firejail/firejail-refresh-links
index 627965b..2d4440d 100755
--- a/firejail/firejail-refresh-links
+++ b/firejail/firejail-refresh-links
@@ -6,15 +6,28 @@
# Parameters
BASENAME="`basename $0`"
DIRNAME="`dirname $0`"
+PATTERN=""
# Ensure we are in the right folder
cd $DIRNAME
-ls -1 /etc/firejail/*profile | \
- sed -e 's|/etc/firejail/||g' -e 's/.profile$//' | while read profile; do
- if which $profile &> /dev/null; then
- if [ ! -h "$profile" ]; then
- ln -s /usr/bin/firejail $profile
- fi
+# Add global folder
+if [ -d "/etc/firejail" ]; then
+ PATTERN="$PATTERN /etc/firejail/*profile"
+fi
+
+# Add local folder
+if [ -d "$HOME/.config/firejail" ]; then
+ PATTERN="$PATTERN $HOME/.config/firejail/*profile"
+fi
+
+if [ ! -z "$PATTERN" ]; then
+ ls -1 $PATTERN | \
+ sed -e 's|/etc/firejail/||g' -e "s|$HOME/.config/firejail/||g" -e 's/.profile$//' | sort | uniq | while read profile; do
+ if which $profile &> /dev/null; then
+ if [ ! -h "$profile" ]; then
+ ln -s /usr/bin/firejail $profile
fi
+ fi
done
+fi