aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-11-25 21:09:26 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-11-25 21:09:26 +0300
commitd93e1a3e214253cffb1a99e8e3dff8d378ace8ac (patch)
tree59f7aeadd28c4082a35d196b45d3a491536b6526 /src
parentupdate script names in comments (diff)
downloadconfig-links-d93e1a3e214253cffb1a99e8e3dff8d378ace8ac.tar.gz
config-links-d93e1a3e214253cffb1a99e8e3dff8d378ace8ac.zip
add links-chmod
Diffstat (limited to '')
-rw-r--r--src/db.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/db.sh b/src/db.sh
index 6145c6d..0022ab9 100644
--- a/src/db.sh
+++ b/src/db.sh
@@ -262,3 +262,17 @@ unlink_obsolete_entries() {
fi
done
}
+
+chmod_entries() {
+ if [ "$#" -ne 1 ]; then
+ echo "usage: ${FUNCNAME[0]} MODE" >&2
+ return 1
+ fi
+
+ local mode="$1"
+ shift
+
+ if [ "${#shared_paths[@]}" -ne 0 ]; then
+ is_dry_run || chmod -- "$mode" ${shared_paths[@]+"${shared_paths[@]}"}
+ fi
+}