Network
PPP First Login Date Stamp — v6 & v7
On-Up script for PPP profiles. On a secret's first connection it writes the date and time at the start of the secret's comment. The 'PPP Accounts Auto-Disable' script uses that stamp to count the validity.
RouterOS v6 & v7
# EN: $user is filled in by RouterOS when the PPP session comes up
# AR: المتغير $user يملؤه النظام عند اتصال جلسة PPP
:do {
:local sec [/ppp secret find where name=$user];
:local note [/ppp secret get $sec comment];
# EN: Skip if the comment already has a date/mark (contains / - or @)
# AR: تخطي الحساب إذا كان الكومنت يحتوي تاريخاً أو علامة (/ أو - أو @)
:if (!($note~"/" || $note~"-" || $note~"@")) do={
:local stamp ([/system clock get date] . " " . [/system clock get time]);
/ppp secret set $sec comment=($stamp . " - - " . $note);
}
} on-error={ :log warning ("ppp: cannot stamp first login for " . $user) }