Hirdetés
-
PROHARDVER!
Mikrotik routerekkel foglalkozó téma. Mikrotik router típusok, hardverek, router beállítások, programozás (scriptek írása), frissítés, és minden Mikrotik routerrel kapcsolatos beszélgetés helye.
Új hozzászólás Aktív témák
-
kovyhun
tag
válasz
byson55
#8725
üzenetére
Szia,
én ezt használom:
# Script to forward SMS from GSM Modem Inbox to Email #
# Note: The SMS is removed from the inbox after being sent to Email, #
# even if the Email fails to be sent #
# Remember to set up /Tools/SMS with the USB port of your #
# Modem and the info channel. Put anything in secret and #
# make sure Receive Enabled is ticked #
# Tested on Rb751U RouterOS v5.12 with Huawei E367 #
# Peter James 2012-04-04 #
:local EmailAddress "your_email_address";
:local smsPhone;
:local smsTimeStamp;
:local smsMessage;
:local smsContent;
# Get System Identity #
:local SystemID [/system identity get name];
:log info "SMS to Email script started";
# Set Receive Enabled, in case it was cleared by a router reboot #
/tool sms set receive-enabled=yes;
delay 2;
# loop through all the messages in the inbox #
:foreach i in=[/tool sms inbox find] do={
:set smsPhone [/tool sms inbox get $i phone];
:set smsTimeStamp [/tool sms inbox get $i timestamp];
:set smsMessage [/tool sms inbox get $i message];
:set smsContent "Router ID: $SystemID\nSMS Received from: $smsPhone\nDate&Time: $smsTimeStamp\nMessage: $smsMessage";
:log info $smsContent;
/tool e-mail send tls=yes subject="$SystemID GSM Modem SMS Received" to=$EmailAddress body="$smsContent";
# Now remove the SMS from the inbox #
/tool sms inbox remove $i;
delay 10;
}
# clear Receive Enabled, so info channel can be used by other scripts #
/tool sms set receive-enabled=no;
:log info "SMS to Email script complete";(Nem engedi ez az új fórum programkódba formázni)
-
ekkold
Topikgazda
válasz
byson55
#8725
üzenetére
Nem írtam még ilyen szkriptet, mert nincs olyan mikrotik eszközöm ami SMS-t kap. De amin elindulhatsz: a script lényegében egy szövegfájl amiben szöveges parancsok vannak felsorolva, ugyanolyanok mint amit terminálban is ki lehet adni. Az SMS-re vonatkozó parancsok a
/tool sms
alatt érhetők el, pl az SMS-ek kiírása:
/tool sms inbox print
Kell egy for ciklus ami végigmegy az inboxban levő SMS-eken, a ciklusba pedig bele kell tenni, hogy mit kezdjen vele, pl.
/tool e-mail send to=cimzett@domain.hu body=sms_szoveg subject=sms
Remélem segítettem valamennyit. Kísérletezz bátran.
Új hozzászólás Aktív témák
- Realme 9 Pro 128GB, Kártyafüggetlen, 1 Év Garanciával
- GYÖNYÖRŰ iPhone 12 mini 128GB Blue -1 ÉV GARANCIA - Kártyafüggetlen, MS3881
- GYÖNYÖRŰ iPhone 13 Mini 128GB Blue- 1 ÉV GARANCIA -Kártyafüggetlen, MS4062
- iKing - Xiaomi 14T Pro Titan Gray Vékony, prémium kivitel, nagy kijelző 12/512
- BESZÁMÍTÁS! SAPPHIRE B650M R7 8700F 16GB DDR5 512GB SSD RTX 4060Ti 8GB Zalman S2 TG ADATA 600W
Állásajánlatok
Cég: Laptopszaki Kft.
Város: Budapest
Cég: BroadBit Hungary Kft.
Város: Budakeszi
ekkold

