mirror of
https://github.com/gbudny93/RouterOS_Useful_Scripts.git
synced 2025-06-21 09:35:43 +02:00
Update
This commit is contained in:
parent
ff04ad34f2
commit
2f897350bc
2 changed files with 54 additions and 10 deletions
32
README.md
32
README.md
|
@ -9,6 +9,13 @@
|
||||||
|
|
||||||
## Change log
|
## Change log
|
||||||
|
|
||||||
|
- 15/4/2020
|
||||||
|
- RouterOS_Cloud_Backup.rsc
|
||||||
|
- RouterOS_FTP_Backup.rsc
|
||||||
|
- RouterOS_Function_Template.rsc
|
||||||
|
- RouterOS_PPP_Disconnect_Active_Sessions.rsc
|
||||||
|
- RouterOS_Recreate_Bridge.rsc
|
||||||
|
|
||||||
- 12/4/2019
|
- 12/4/2019
|
||||||
- RouterOS_RadiusMonitor.rsc
|
- RouterOS_RadiusMonitor.rsc
|
||||||
- RouterOS_User_Alerts.rsc
|
- RouterOS_User_Alerts.rsc
|
||||||
|
@ -137,7 +144,7 @@ recipient=recipient@example.com;
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
```
|
```
|
||||||
$CloudBackup smtpServer=smtpServer smtpPort=smtpPort domain=@example.com recipient=recipient@example.com;
|
$CloudBackup password=password;
|
||||||
```
|
```
|
||||||
|
|
||||||
### RouterOS_Create_Directory.rsc
|
### RouterOS_Create_Directory.rsc
|
||||||
|
@ -320,6 +327,29 @@ $UserAlert message="message" treshhold=3 fileName="fileName" smtpServer=smtpServ
|
||||||
recipient="recipient@example.com";
|
recipient="recipient@example.com";
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### RouterOS_FTP_Backup.rsc
|
||||||
|
> Creates backup files and sends them via FTP to FTP server
|
||||||
|
|
||||||
|
**Example**
|
||||||
|
```
|
||||||
|
$FTPBackup configName=configName backupName=backupName smtpServer=smtpServer smtpPort=smtpPort domain=@example.com \
|
||||||
|
recipient=recipient@example.com destPath=destPath ftpUser=user ftpPassword=password ftpServer=ftpserver;
|
||||||
|
```
|
||||||
|
|
||||||
|
### RouterOS_Function_Template.rsc
|
||||||
|
> Function template that I use
|
||||||
|
|
||||||
|
### RouterOS_PPP_Disconnect_Active_Sessions.rsc
|
||||||
|
> Disconnects all PPP active sessions at once
|
||||||
|
|
||||||
|
**Example**
|
||||||
|
```
|
||||||
|
$DisconnectPPPActveSessions;
|
||||||
|
```
|
||||||
|
|
||||||
|
### RouterOS_Recreate_Bridge.rsc
|
||||||
|
> Recreates bridge if broken or misconfigured
|
||||||
|
|
||||||
### More scripts comming soon :)
|
### More scripts comming soon :)
|
||||||
|
|
||||||
## Authors
|
## Authors
|
||||||
|
|
|
@ -1,26 +1,40 @@
|
||||||
# RouterOS Function
|
# RouterOS Function
|
||||||
# Copyright (c) Grzegorz Budny
|
# Copyright (c) Grzegorz Budny
|
||||||
# Version 1.1
|
# Version 1.2
|
||||||
# Last update: 2/14/2020
|
# Last update: 3/15/2020
|
||||||
# Creates new backup file and uploads it to MikroTik Cloud
|
# Creates new backup file and uploads it to MikroTik Cloud
|
||||||
|
|
||||||
:global CloudBackup do={
|
:global CloudBackup do={
|
||||||
|
|
||||||
:local systemLicense [/system license get value-name=level];
|
|
||||||
:local systemName [/system identity get value-name=name];
|
:local systemName [/system identity get value-name=name];
|
||||||
|
:local backupNumber [/system backup cloud print count-only];
|
||||||
|
|
||||||
:if ($currentLicenseLevel != "free") do={
|
:if ($backupNumber = 0) do={
|
||||||
|
|
||||||
:log info "...:::License allows cloud backup, process started:::..."
|
:log info "...:::No Cloud Backup Present!:::...";
|
||||||
|
:log info "...:::Cloud backup process started:::...";
|
||||||
|
|
||||||
/system backup cloud upload-file action=create-and-upload file=cloudBackup.backup password=password
|
/system backup cloud upload-file action=create-and-upload name=$systemName password=$password;
|
||||||
|
|
||||||
/tool e-mail send server=$smtpServer port=$smtpPort from=($systemName.$domain) \
|
:log info "...:::Cloud Backup Created:::...";
|
||||||
to=$recipient subject=($systemName." cloud backup created.") body=($systemName." created MikroTik cloud backup.");
|
|
||||||
|
}
|
||||||
|
|
||||||
|
:if ($backupNumber > 0) do={
|
||||||
|
|
||||||
|
:log warning "...:::Cloud Backup Present!:::...";
|
||||||
|
:log info "...:::Cloud backup process started:::...";
|
||||||
|
|
||||||
|
:log warning "...:::Removing current slot!:::...";
|
||||||
|
/system backup cloud remove-file 0;
|
||||||
|
:log warning "...:::Slot removed:::...";
|
||||||
|
|
||||||
|
:log info "...:::Cloud backup process started:::...";
|
||||||
|
/system backup cloud upload-file action=create-and-upload name=$systemName password=$password;
|
||||||
|
|
||||||
:log info "...:::Cloud Backup Created:::...";
|
:log info "...:::Cloud Backup Created:::...";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$CloudBackup smtpServer=smtpServer smtpPort=smtpPort domain=@example.com recipient=recipient@example.com;
|
$CloudBackup password=password
|
Loading…
Add table
Add a link
Reference in a new issue