|
@@ -19,7 +19,17 @@ if [ $1 -eq 1 ]; then
|
|
|
/usr/bin/chown -R sftpgo:sftpgo /etc/sftpgo /var/lib/sftpgo /srv/sftpgo
|
|
|
/usr/bin/chmod 750 /etc/sftpgo /var/lib/sftpgo /srv/sftpgo
|
|
|
/usr/bin/chmod 640 /etc/sftpgo/sftpgo.json
|
|
|
- echo "Please be sure to have the python requests library installed if you want to use the REST API CLI"
|
|
|
+ /bin/echo "Please be sure to have the python requests library installed if you want to use the REST API CLI"
|
|
|
fi
|
|
|
+
|
|
|
+# check permissions for /srv/sftpgo and adjust them if needed
|
|
|
+if [ -d /srv/sftpgo ]; then
|
|
|
+ if [ $(/usr/bin/stat -c '%U' /srv/sftpgo) != sftpgo ]; then
|
|
|
+ /bin/echo "Set permissions for /srv/sftpgo"
|
|
|
+ /usr/bin/chown -R sftpgo:sftpgo /srv/sftpgo
|
|
|
+ /usr/bin/chmod 750 /srv/sftpgo
|
|
|
+ fi
|
|
|
+fi
|
|
|
+
|
|
|
# reload to pick up any changes to systemd files
|
|
|
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|