summarylogtreecommitdiffstats
path: root/gnunet.install
diff options
context:
space:
mode:
authorgrufo2021-09-19 13:30:16 +0100
committergrufo2021-09-19 13:30:16 +0100
commitf9aa770527455b6e175dd79c5ec6ccd4a7ca0b4b (patch)
tree4904c61f552698cdbee44732bf44dc14f951a69d /gnunet.install
parent10249e4609f38edc83b7faf0bab7de3079295467 (diff)
downloadaur-f9aa770527455b6e175dd79c5ec6ccd4a7ca0b4b.tar.gz
File and directory permissions
Diffstat (limited to 'gnunet.install')
-rw-r--r--gnunet.install14
1 files changed, 9 insertions, 5 deletions
diff --git a/gnunet.install b/gnunet.install
index 195e63723ef8..26160eccc0b9 100644
--- a/gnunet.install
+++ b/gnunet.install
@@ -2,14 +2,18 @@ post_install() {
local _PWD_PAIRS_="$(awk -F ':' '$3>=1000 && $3<2000 {print $1":"$6}' '/etc/passwd')"
local _USER_
- local _CFG_FILE_
+ local _GROUP_
+ local _CFG_DIR_
for _PWD_PAIR_ in ${_PWD_PAIRS_}; do
_USER_="$(echo $_PWD_PAIR_ | cut -d ':' -f 1)"
- _CFG_FILE_="$(echo $_PWD_PAIR_ | cut -d ':' -f 2)/.config/gnunet.conf"
- test -e "${_CFG_FILE_}" || install -Dm644 -o "${_USER_}" -g \
- "$(id -gn "${_USER_}")" /etc/skel/.config/gnunet.conf \
- "${_CFG_FILE_}"
+ _GROUP_="$(id -gn "${_USER_}")"
+ _CFG_DIR_="$(echo $_PWD_PAIR_ | cut -d ':' -f 2)/.config"
+ test -e "${_CFG_DIR_}/gnunet.conf" || (install -dm700 -o \
+ "${_USER_}" -g "${_GROUP_}" "${_CFG_DIR_}" && install \
+ -Dm600 -o "${_USER_}" -g "${_GROUP_}" \
+ '/etc/skel/.config/gnunet.conf' \
+ "${_CFG_DIR_}/gnunet.conf")
done
echo