summarylogtreecommitdiffstats
path: root/sshd_autoban.install
diff options
context:
space:
mode:
Diffstat (limited to 'sshd_autoban.install')
-rw-r--r--sshd_autoban.install44
1 files changed, 25 insertions, 19 deletions
diff --git a/sshd_autoban.install b/sshd_autoban.install
index cc2b97d8b485..6d39a82cc646 100644
--- a/sshd_autoban.install
+++ b/sshd_autoban.install
@@ -1,32 +1,38 @@
post_install() {
- echo
- echo "Becareful, you must edit /etc/sshd_autoban/sshd_autoban.json"
- echo
+ pkgname=sshd_autoban
- # Create directories
+ # Fixing membership
+ chown root: /var/log/$pkgname
+ chown -R root: /etc/$pkgname
- # mkdir -p "$pkgdir/var/log/sshd_autoban/"
+ # Reload systemctl
+ systemctl daemon-reload
- # Fixing right
+ echo "Adding sshd_autoban in systemctl:"
+ echo " systemctl enable sshd_autoban"
+ echo " systemctl start sshd_autoban"
- chmod 644 "$pkgdir/etc/sshd_autoban/sshd_autoban.json"
- chmod 755 "$pkgdir/var/log/sshd_autoban"
- chmod 755 "$pkgdir/var/log/sshd_autoban/errors.log"
- chmod 755 "$pkgdir/usr/bin/sshd_autoban"
+ true
+}
- # Fixing membership
+post_upgrade() {
+ # Reload systemctl
+ systemctl daemon-reload
- chown -R root: "/var/log/sshd_autoban"
- chown root: "/etc/sshd_autoban/sshd_autoban.json"
+ echo "You should restart sshd_autoban:"
+ echo " systemctl restart sshd_autoban"
- true
+ true
}
-post_upgrade() {
- echo "Reload systemctl"
+pre_remove() {
+ pkgname=sshd_autoban
+ # Remove symlink in systemd
+ systemctl disable $pkgname
+ # Stop server
+ systemctl stop $pkgname
+ # Reload systemctl
systemctl daemon-reload
-}
-post_remove() {
- true
+ true
}