summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał 'rysiek' Woźniak <rysiek@hackerspace.pl>2017-02-24 18:23:40 +0100
committerMichał 'rysiek' Woźniak <rysiek@hackerspace.pl>2017-02-24 18:23:40 +0100
commitb92ce339958b2bc08d58c17537867c2eaa74c36e (patch)
tree25849941fa4026b48c5977d6624b4997086d7460
parent725b193398d59d51acbc1ea0b9480d4648d4dbc9 (diff)
downloadkuvert-b92ce339958b2bc08d58c17537867c2eaa74c36e.tar.gz
kuvert-b92ce339958b2bc08d58c17537867c2eaa74c36e.tar.bz2
kuvert-b92ce339958b2bc08d58c17537867c2eaa74c36e.zip
run.sh: config can be on a read-only filesystem; warn instead of fail when unable to change ower/perms
-rw-r--r--run.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/run.sh b/run.sh
index 1eee6f6..aab9b67 100644
--- a/run.sh
+++ b/run.sh
@@ -20,8 +20,10 @@ function watch_pubkeys {
# permissions and ownership
echo " +-- making sure permissions are AOK..."
# just the relevant files, gpg creates .lock and .tmp files too, we're going to ignore those
- chown "$KUVERT_USER":"$KUVERT_GROUP" "$KUVERT_GNUPG_DIR/" "$KUVERT_GNUPG_DIR/"*.gpg "$KUVERT_GNUPG_DIR/"*.gpg~
- chmod u=rwX,go= "$KUVERT_GNUPG_DIR/" "$KUVERT_GNUPG_DIR/"*.gpg "$KUVERT_GNUPG_DIR/"*.gpg~
+ chown "$KUVERT_USER":"$KUVERT_GROUP" "$KUVERT_GNUPG_DIR/" "$KUVERT_GNUPG_DIR/"*.gpg "$KUVERT_GNUPG_DIR/"*.gpg~ || \
+ echo "WARNING: unable to change ownership!"
+ chmod u=rwX,go= "$KUVERT_GNUPG_DIR/" "$KUVERT_GNUPG_DIR/"*.gpg "$KUVERT_GNUPG_DIR/"*.gpg~ || \
+ echo "WARNING: unable to change permissions!"
# now the important stuff
echo " +-- reloading kuvert config and keyring..."
su -p -c "env PATH=\"$PATH\" kuvert -r" "$KUVERT_USER"
@@ -158,12 +160,14 @@ echo " +-- changing ownership..."
chown -R "$KUVERT_USER":"$KUVERT_GROUP" "$KUVERT_LOGS_DIR"
chown -R "$KUVERT_USER":"$KUVERT_GROUP" "$KUVERT_QUEUE_DIR"
chown -R "$KUVERT_USER":"$KUVERT_GROUP" "$KUVERT_GNUPG_DIR"
-chown -R "$KUVERT_USER":"$KUVERT_GROUP" "$KUVERT_CONFIG_DIR"
+chown -R "$KUVERT_USER":"$KUVERT_GROUP" "$KUVERT_CONFIG_DIR" || \
+ echo "WARNING: unable to change ownership of $KUVERT_CONFIG_DIR!"
echo " +-- changing permissions..."
chmod -R u=rwX,g=rX,o= "$KUVERT_LOGS_DIR"
chmod -R u=rwX,go= "$KUVERT_QUEUE_DIR" # queue dir has to be readable only to kuvert user
chmod -R u=rwX,go= "$KUVERT_GNUPG_DIR" # gnupg home dir has to be readable only to kuvert user
-chmod -R u=rwX,g=rX,o= "$KUVERT_CONFIG_DIR"
+chmod -R u=rwX,g=rX,o= "$KUVERT_CONFIG_DIR" || \
+ echo "WARNING: unable to change permissions of $KUVERT_CONFIG_DIR!"
#
# kuvert explicitly expects the config file to be ~/.kuvert, so we need to link it to the actual config file,