الرئيسية

السبت، 29 سبتمبر 2018

عمل صلاحية في الهوتسبوت بطريقة فعالة | ماكس ابجريد

طريقة عمل صلاحية للهوتسبوت بطريقة فعالة

اولاً : الصلاحية بالأيام فقط ونقوم بكتابة الصلاحية في كومنت اليوزر برقم عدد الايام
كما في الصورة فإن صلاحية هذا اليوزر ستكون 10 أيام من أول تسجيل الدخول


ثانياً نقوم بعمل السكريبت التالي في البروفايل المستخدم عند تسجيل الدخول on-login

{
:global today;
{
:local date [ /system clock get date ];
:local montharray ( "jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec" );
:local monthdays ( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 );
:local days [ :pick $date 4 6 ];
:local monthtxt [ :pick $date 0 3 ];
:local year [ :pick $date 7 11 ];
:local months ([ :find $montharray $monthtxt]);
:for nodays from=0 to=$months do={
:set days ( $days + [ :pick $monthdays $nodays ] )};
:set days ($days + $year * 365);
:set today $days;
:local comm [/ip hotspot user get $user comment];
:if ( $comm != "" and [:tonum $comm]<735000) do={
:local ahmedcom ([:tonum $comm] + $today)
/ip hotspot user set $user comment="$ahmedcom";
}
}
}

ثم نقوم بعمل السكريبت التالي على New Terminal

/system scheduler
add interval=1h name=hotspotvalidate 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\",\"jul\",\"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>=735000] do={\r\
    \n:local comm [/ip hotspot user get \$i comment];\r\
    \n:if ( [:tonum \$comm] < \$today ) do={\r\
    \n:local ahmedcom ([:tonum \$comm] + \$today)\r\
    \n:local username [/ip hotspot user get \$i name];\r\
    \n:log info \"MAX-BOX SYSTEM user \$username disabled by becuase its valitity expire\";\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}" start-date=sep/29/2000 start-time=01:00:00



انظموا معنا على جروبنا في الفيس بوك جروب شبكات لاسلكية
--------------------

ماكس ابجريد لخدمات الشبكات والبرمجيات
ت : 00967
01214433
771204505
736024667
777239993
او مراسلتنا على صفحتنا في الفيس بوك


بقلم الكاتب :
مهندس / أحمد محمد العليمي
هندسة وبرمجة شبكات | اليمن - صنعاء | ت : 771204505 - 736024667

هناك 6 تعليقات:

  1. ابداع ماشاء الله عليكم وهناكم الله العلم
    ونفع بعلمكم وكتب اجركم

    ردحذف
  2. نشتي مكان للسكريبت غير الهوتسبوت بروفايل لان الي معاهم سكريبت تقسيم حسب الاكتف ماعد بيشتغل ويحسب دقيق دخول وخروج المشتركين

    ردحذف
    الردود
    1. تقدر تعمله قبل سكريبت التقسيم وتعمل سطر فراغ بينهم

      حذف
  3. ماقدارت اصلح الصلاحيه مثل الصوره

    ردحذف
  4. جزاك الله خيرا .. هل نستطيع اضافة محتوى الكومنت في صفحة الstatus

    ردحذف