التخطي إلى المحتوى الرئيسي

حل مشكله الصلاحيه وتصفير الكروت للهوست بوت

بسم الله الرحمان الرحيم

نقدم لكم اليوم حل مشكله الصلاحيه+تصفير الكروت في الهوست بوت
الحل يتناسب مع برنامج هوائي فقط.

ناتي الي الشرح

اولا نضع الامر في يوزر بروفايل on-login
/import alssman;




ثانيا نضع الامر التالي في يوزر بروفايل on-logout



{:local content [ /ip hotspot user get $user comment ];:local Uuptime [ /ip hotspot user get $user uptime];:local LimitUptime [ /ip hotspot user get $user limit-uptime ];:local limitBytesTotal [ /ip hotspot user get $user limit-bytes-total];:local bytesOut [ /ip hotspot user get $user bytes-out];:local IscommentAnd [ :find $content "&" ];:local IscommentStar [ :find $content "*" ];:if ( $IscommentAnd >= 0 && $IscommentStar >=0) do={:local pos1 [:find $content "*"];:local pos2 [:len $content];:local comment [:pick $content 0 ($pos1) ]; :local Timeleft;:local Sizletf;:if ([:len $LimitUptime] = 0)   do={ :set Timeleft unlimited};:if ([:len $LimitUptime] != 0)   do={  :set Timeleft ($LimitUptime - $Uuptime);};:if ([:len $limitBytesTotal] = 0)    do={ :set Sizletf unlimited};:if ([:len $limitBytesTotal] != 0)    do={:set Sizletf ($limitBytesTotal - $bytesOut);};[/ip  hotspot user set $user comment=($comment . "*" . $Sizletf . "&" . $Timeleft)];};};









ثالثا اعمل الاوامر في نيو ترمنال
/system script
add name=Save_Session_TimeLeft_774278910 owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive source="{:forea\
    ch i in [ /ip hotspot active find where !radius ] do={:local SessionTimeLe\
    ft [ /ip hotspot active get \$i session-time-left];:local SizeTimeLeft [ /\
    ip hotspot active get \$i limit-bytes-total];:local username [ /ip hotspot\
    \_active get \$i user];:local content [ /ip hotspot user get \$username co\
    mment ];:if ([:len \$SessionTimeLeft] = 0)   do={ set SessionTimeLeft unli\
    mited};:if ([:len \$SizeTimeLeft] = 0) do={ set SizeTimeLeft unlimited};:l\
    ocal IscommentAnd [ :find \$content \"&\" ];:local IscommentStar [ :find \
    \$content \"*\" ];:if ( \$IscommentAnd >= 0 && \$IscommentStar >=0) do={:l\
    ocal pos1 [:find \$content \"*\"];:local pos2 [:len \$content];:local SubC\
    omment [:pick \$content 0 (\$pos1) ];[/ip  hotspot user set \$username com\
    ment=(\$SubComment . \"*\" . \$SizeTimeLeft . \"&\" . \$SessionTimeLeft)];\
    };};}; "
add name=Check_Session_TimeLeft_After_Shutdown_774278910 owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive source=" {:fore\
    ach i in [ /ip hotspot user find where disabled=no] do={:local name [ /ip \
    hotspot user get \$i name ];:local content [ /ip hotspot user get \$i comm\
    ent ];:local uptime [ /ip hotspot user get \$i uptime ];:local limitUptime\
    \_[ /ip hotspot user get \$i limit-uptime ];:local limitBytesTotal [ /ip h\
    otspot user get \$i limit-bytes-total];:local bytesOut [ /ip hotspot user \
    get \$i bytes-out];:local IscommentAnd [ :find \$content \"&\" ];:local Is\
    commentStar [ :find \$content \"*\" ];:if ( \$IscommentAnd >= 0 && \$Iscom\
    mentStar >=0) do={:local SubComment;:local Sizletf;:local Timeleft;:local \
    pos1 [:find \$content \"*\"];:local pos3 [:len \$content];:local pos2 ([:f\
    ind [:pick \$content (\$pos1+1) \$pos3] \"&\"]+\$pos1+1);:set SubComment [\
    :pick \$content 0 (\$pos1)];:set Sizletf    [:pick \$content (\$pos1+1) \$\
    pos2];:set Timeleft   [:pick \$content (\$pos2+1) (\$pos3)];:if ( ([:totim\
    e \$Timeleft] > 00:00:00) && \$Timeleft != \"unlimited\" ) do={:if ( \$Tim\
    eleft < (\$limitUptime - \$uptime)) do={[/ip  hotspot user set \$name limi\
    t-uptime= (\$Timeleft + \$uptime )];};};:if (\$Sizletf < \$limitBytesTotal\
    \_&& \$Sizletf !=\"unlimited\" ) do={:if ( \$Sizletf < (\$limitBytesTotal \
    - \$bytesOut)) do={[ /ip  hotspot user set \$name limit-bytes-total= (\$Si\
    zletf + \$bytesOut )];};};};};}; ";



/system scheduler
add name=Check_Session_TimeLeft_After_Shutdown on-event=\
    Check_Session_TimeLeft_After_Shutdown_774278910 policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive start-time=\
    startup
add interval=10m name=Save_Session_TimeLeft on-event=Save_Session_TimeLeft_774278910 \
    policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=3h name=alharth_alssman on-event="{\r\
    \n:global today;\r\
    \n{\r\
    \n:local date [ /system clock get date ];\r\
    \n:local montharray ( \"jan\",\"feb\",\"mar\",\"apr\",\"may\",\"jun\",\"ju\
    l\",\"aug\",\"sep\",\"oct\",\"nov\",\"dec\" );\r\
    \n:local monthdays ( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 );\r\
    \n:local days [ :pick \$date 4 6 ];\r\
    \n:local monthtxt [ :pick \$date 0 3 ];\r\
    \n:local year [ :pick \$date 7 11 ];\r\
    \n:local months ([ :find \$montharray \$monthtxt]);\r\
    \n:for nodays from=0 to=\$months do={\r\
    \n:set days ( \$days + [ :pick \$monthdays \$nodays ] )};\r\
    \n:set days (\$days + \$year * 365);\r\
    \n:set today \$days;\r\
    \n:foreach i in=[ /ip hotspot user find where disabled=no and comment~\"@\
    \"] do={\r\
    \n:local comm [/ip hotspot user get \$i comment];\r\
    \n:local h2 [:find \$comm #];\r\
    \n:local z [:pick \$comm 12  \$h2];\r\
    \n:if ( [:tonum \$z] < \$today ) do={\r\
    \n:local username [/ip hotspot user get \$i name];\r\
    \n:log info \"user man \$username disabled by Alharth alssman_774278910\";\
    \r\
    \n/ip hotspot user disable \$i;\r\
    \n/ip hotspot active remove [find where user=\$username];\r\
    \n}\r\
    \n}\r\
    \n}\r\
    \n}" policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-time=startup;


ثم نقوم بتنزيل الملف ونقله الي file
لتحميل الملف اضغط هنا







لتحميل الرول في مستند اضغط هنا



------------------------


الحارث السمان
774278910
FB.com/alharth6

تعليقات

المشاركات الشائعة من هذه المدونة

حل مشكله الماكات المكرره في نظام المكروتيك مجاناً

بسم الله الرحمان الرحيم نقدم لكم اليوم حل مشكله الماكات المكرره في المكروتيك الحمايه بتجعل كل ماك يدخل بكرت سواء كانت الكروت على الهوتسبوت او اليوزر مانجر ناتي الي الشرح نضع الباور ماك في سيرفر الهوست بوت مفتوح اولا نضع الامر في يوزر بروفايل on-login /import alharth; ثانيا نضع الامر التالي في يوزر بروفايل on-logout :local z $user /ip dhcp-server lease remove [find comment=$z]; ثالثا اعمل الامر في نيو ترمنال /system scheduler add comment=FB.com/alharth6 name=reboot_MAC on-event="{\r\     \n:foreach h1 in=[/ip dhcp-server lease find] do={\r\     \n:local n [/ip dhcp-server lease get \$h1 comment];\r\     \n:local ss [:len \$n];\r\     \n:if (\"\$ss\"!=\"0\") do={/ip dhcp-server lease remove [find where comme\     nt=\$n];}}\r\     \n}" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \     start-time=startup واخيرا قم بتنزيل الملف التالي و...

تقسيم جديد للسرعه عبر الكيوز سنبل

بسم الله الرحمن الرحيم نقدم لكم اليوم تقسيم جديد لسرعه في المكروتيك الاصدار v2 مميزات التقسيم 1-تقسيم في الكيوز سنبل يتناسب مع جميع الروترات. 2-لا وجود لي رولات في المنجل ولا يرفع المعالج. 3-سرعه محده لاي بروفايل تحب. 4-تحديد سرعه يدويه خارجه عن التقسيم. 5- تقسيم عبر الاكتف يتناسب مع الضغط وقت الذروه. 6-حل مشكله تقطيع النت عند تشغيل التقسيم. والان الي الشرح اولا اعمل توقيف لكل التقسيمات السابقه والتقسيم الثابت ثم وضع السكريبت التالي في الهوتسبوت / يوزر بروفايل في onlogin في كل البروفايلات الموجودة  كما في الصورة /queue simple add max-limit=287k/1000k name=$user target=$address; :delay 2s /system script run al.h.s; ثم في on logout السكريبت التالي /queue simple remove [find name=$user]; /system script run al.h.s; في حالة يوجد سكريبت  في  onlogin او في on logout     لا تقم بحذفه فقط قم بلصق السكريبت قبل السكربتات واخيراً قم بنسخ السكريبت التالي ثم وضعه في  Net Terminal /system script add commen...