JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 18.10.2018, 17:55
JWLLEWELYN JWLLEWELYN is offline
Modem User
 
Join Date: Oct 2018
Posts: 1
Default Kerio Control 9 Firewall OS [Ubuntu/Windows]

Hola este es un script para los que usamos el software comercial, firewall de Kerio Control 9 OS, que esta hecha en en una distro en debian 8 de 64 bits, así como PFSense, SmoothWall, Untangle o Zeroshell, etc...

Lo e probado manualmente desde mi maquina en ubuntu y funciona a la perfección, pero no lo e podido adaptar a jdownloader 2 ya que no tengo idea de como hacer que este script funcione en el programa.

**External links are only visible to Support Staff**
Para que funcione se debe habilitar el SSH en Kerio Control, accediendo al panel de control haciendo una contaminación de "clic + shift" en "Estado --> Sanidad del Sistema" al botón "habilitar SSH".

**External links are only visible to Support Staff**
Luego crean una regla de seguridad que habilite el puerto de comunicación SSH solo en la Interfaces Fiables/Locales o Zona de Confianza.

Este script funciona solo en Ubuntu y requiere los paquetes instalados ssh sspass y permisos de ejecución para el script.
Requiere las credenciales para el acceso remoto del firewall de kerio control 9.

Renewal-IP.sh
Code:
#!/bin/bash
# Autor: John Llewelyn
# Description: Script to renew the IP address of the Kerio Control firewall version 9
# Required packages: ssh sshpass

# Connecting to firewalls
USERNAME="root"
HOSTS="firewall.domain.com"
PASSWORD="mypassword"
PORT="22"
SSH_OPTIONS="-oLogLevel=error"
SSH_OPTIONS="${SSH_OPTIONS} -oStrictHostKeyChecking=no"
SSH_OPTIONS="${SSH_OPTIONS} -oUserKnownHostsFile=/dev/null"

# executing ip renewal task
sshpass -p ${PASSWORD} ssh ${SSH_OPTION} ${USERNAME}@${HOSTS} -p ${PORT} 'killall -SIGUSR2 udhcpc; sleep 5; killall -SIGUSR1 udhcpc; exit'
exit 0
Script Batch para Windows.
Renewal-IP.cmd
Code:
@echo off
title Renews IP address, remote Kerio Control 9 Firewall
rem Autor: John Llewelyn
rem description: Renew the IP address of the Kerio Control 9 firewall remotely.
rem requires the putty program according to its x86 or x64 architecture.

rem Server settings "kerio control firewall" remote ssh
     set username="root"
     set password="mypassword"
     set hostname="firewall.domain.com"
     set port="22"
     set putty="%PROGRAMFILES%\PuTTY\plink.exe"
     set CommandsDir="C:\scripts\ResetInternet\commands.txt"

rem check putty
if exist "%putty%" (
    goto checkcommands
    ) else (
        goto warning
)

rem check commands
:checkcommands
if exist "%CommandsDir%" (
    goto task
    ) else (
        goto createcommands
)

rem Commands
:createcommands
(
	 echo killall -SIGUSR2 udhcpc
	 echo sleep 2
	 echo killall -SIGUSR1 udhcpc
	 echo exit
) >%CommandsDir%

rem Run task to renew IP address
:task
%putty% -ssh %username%@%hostname% -P %port% -pw %password% -m %CommandsDir%
goto finish

rem Warning
:warning
echo "It requires the putty program to work."
timeout 5

:finish
exit /B 0

Last edited by JWLLEWELYN; 19.10.2018 at 02:43. Reason: agregado el script batch para windows
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 08:23.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.