|
|
@@ -75,9 +75,19 @@ fi
|
|
|
# Checking users
|
|
|
shells="rssh|nologin"
|
|
|
for user in $(grep "$HOMEDIR" /etc/passwd |egrep "$shells" |cut -f 1 -d:); do
|
|
|
- $BIN/v-add-user-sftp-jail "$user" "$restart"
|
|
|
+ if [ -d "$HESTIA/data/users/$user" ]; then
|
|
|
+ $BIN/v-add-user-sftp-jail "$user" "no"
|
|
|
+ fi
|
|
|
done
|
|
|
|
|
|
+# Restart ssh service
|
|
|
+if [ "$restart" = 'no' ]; then
|
|
|
+ # Skip restart of SSH daemon
|
|
|
+ echo "" > /dev/null 2>&1
|
|
|
+else
|
|
|
+ service ssh restart > /dev/null 2>&1
|
|
|
+fi
|
|
|
+
|
|
|
# Add v-add-sys-sftp-jail to startup
|
|
|
if [ ! -e "/etc/cron.d/hestia-sftp" ]; then
|
|
|
echo "@reboot root sleep 60 && /usr/local/hestia/bin/v-add-sys-sftp-jail" > /etc/cron.d/hestia-sftp
|