Skip to content

Commit 70e3a25

Browse files
committed
Run sys sftp jail after once after reboot.
1 parent 9743e6d commit 70e3a25

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

bin/v-add-sys-sftp-jail

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ for user in $(grep "$HOMEDIR" /etc/passwd |egrep "$shells" |cut -f 1 -d:); do
6969
$BIN/v-add-user-sftp-jail $user
7070
done
7171

72+
# Add v-add-sys-sftp-jail to startup
73+
if [ ! -e "/etc/cron.d/hestia-sftp" ]; then
74+
echo "@reboot /usr/local/hestia/bin/v-add-sys-sftp-jail" > /etc/cron.d/hestia-sftp
75+
chmod +x /etc/rc.local
76+
fi
77+
7278
#----------------------------------------------------------#
7379
# Hestia #
7480
#----------------------------------------------------------#

bin/v-delete-sys-sftp-jail

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ if [ "$restart" = 'yes' ]; then
6565
fi
6666
fi
6767

68+
# Remove v-add-sys-sftp-jail to startup
69+
if [ ! -e "/etc/cron.d/hestia-sftp" ]; then
70+
rm "@reboot /usr/local/hestia/bin/v-add-sys-sftp-jail" > /etc/cron.d/hestia-sftp
71+
fi
72+
6873

6974
#----------------------------------------------------------#
7075
# Hestia #

0 commit comments

Comments
 (0)