aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-11-25 19:06:47 +0000
committerEgor Tensin <Egor.Tensin@gmail.com>2021-11-25 19:06:47 +0000
commit4d7904fd36ca5078b47b372691b4c16b256f3307 (patch)
tree5735f76f55dd4853010673a88375b6b136b742c8 /src
parentdebian: 1.0.1-1 (diff)
parentREADME: update (diff)
downloadconfig-links-4d7904fd36ca5078b47b372691b4c16b256f3307.tar.gz
config-links-4d7904fd36ca5078b47b372691b4c16b256f3307.zip
Merge tag 'v1.1' into debian
Diffstat (limited to 'src')
-rw-r--r--src/db.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/db.sh b/src/db.sh
index 6145c6d..5eb1697 100644
--- a/src/db.sh
+++ b/src/db.sh
@@ -262,3 +262,18 @@ unlink_obsolete_entries() {
fi
done
}
+
+chmod_entries() {
+ if [ "$#" -ne 1 ]; then
+ echo "usage: ${FUNCNAME[0]} MODE" >&2
+ return 1
+ fi
+
+ local mode="$1"
+ shift
+
+ echo "Applying mode $mode to shared files..."
+ if [ "${#shared_paths[@]}" -ne 0 ]; then
+ is_dry_run || chmod -- "$mode" ${shared_paths[@]+"${shared_paths[@]}"}
+ fi
+}