{"id":181,"date":"2017-06-01T15:10:55","date_gmt":"2017-06-01T13:10:55","guid":{"rendered":"http:\/\/wp1.fredptitgars.net\/index.php\/2017\/06\/01\/personnalisation-de-la-banniere-de-login-motd\/"},"modified":"2017-06-01T15:10:55","modified_gmt":"2017-06-01T13:10:55","slug":"personnalisation-de-la-banniere-de-login-motd","status":"publish","type":"post","link":"https:\/\/fredptitgars.ovh\/?p=181","title":{"rendered":"Personnalisation de la banni\u00e8re de login &#8211; Motd"},"content":{"rendered":"<p>On cr\u00e9e le fichier:<br \/>\n<code><br \/>\n\/usr\/local\/bin\/dynmotd<br \/>\n<\/code><\/p>\n<p>On y insert les lignes suivante:<\/p>\n<p><code><br \/>\n#!\/bin\/bash<\/p>\n<p>PROCCOUNT=`ps -l | wc -l`<br \/>\nPROCCOUNT=`expr $PROCCOUNT - 4`<\/p>\n<p>if [[ $(groups) == *irc* ]]; then<br \/>\nENDPROC=`cat \/etc\/security\/limits.conf | grep \"@irc\" | grep nproc | awk <em>'print $4'<\/em>`<br \/>\nENDSESSION=`cat \/etc\/security\/limits.conf | grep \"@irc\" | grep maxlogins | awk <em>'print $4'<\/em>`<br \/>\nPRIVLAGED=\"IRC Account\"<br \/>\nelse<br \/>\nENDPROC=`cat \/etc\/security\/limits.conf | grep \"*\" | grep nproc | awk <em>'print $4'<\/em>`<br \/>\nENDSESSION=\"Unlimited\"<br \/>\nPRIVLAGED=\"Regular User\"<br \/>\nfi<br \/>\necho -e \"\\033[1;32m<br \/>\n _____    ________    _____   ________<br \/>\n(  __ \\  (___  ___)  (_   _) (___  ___)<br \/>\n ) )_) )     ) )       | |       ) )<br \/>\n(  ___\/     ( (        | |      ( (<br \/>\n ) )         ) )       | |       ) )<br \/>\n( (         ( (       _| |__    ( (<br \/>\n\/__\\        \/__\\     \/_____(    \/__\\<br \/>\n       _____      ____     ______      _____<br \/>\n      \/ ___ \\    (    )   (   __ \\    \/ ____\\<br \/>\n     \/ \/   \\_)   \/ \/\\ \\    ) (__) )  ( (___<br \/>\n    ( (  ____   ( (__) )  (    __\/    \\___ \\<br \/>\n    ( ( (__  )   )    (    ) \\ \\  _       ) )<br \/>\n     \\ \\__\/ \/   \/  \/\\  \\  ( ( \\ \\_))  ___\/ \/<br \/>\n      \\____\/   \/__(  )__\\  )_) \\__\/  \/____\/   <\/p>\n<p>\\033[0;35m+++++++++++++++++: \\033[0;37mSystem Data\\033[0;35m :+++++++++++++++++++<br \/>\n+  \\033[0;37mHostname \\033[0;35m= \\033[1;32m`hostname`<br \/>\n\\033[0;35m+   \\033[0;37mAddress \\033[0;35m= \\033[1;32m192.168.0.12<br \/>\n\\033[0;35m+    \\033[0;37mSystem \\033[0;35m= \\033[1;32m`lsb_release -s -d`<br \/>\n\\033[0;35m+    \\033[0;37mKernel \\033[0;35m= \\033[1;32m`uname -r`<br \/>\n\\033[0;35m+    \\033[0;37mUptime \\033[0;35m= \\033[1;32m`uptime | sed 's\/.*up \\([^,]*\\), .*\/\\1\/'`<br \/>\n\\033[0;35m+       \\033[0;37mCPU \\033[0;35m= \\033[1;32mDual-Core AMD Opteron(tm) Processor 1214<br \/>\n\\033[0;35m+    \\033[0;37mMemory \\033[0;35m= \\033[1;32m`cat \/proc\/meminfo | grep MemTotal | awk <em>'print $2'<\/em>` kB<br \/>\n\\033[0;35m++++++++++++++++++: \\033[0;37mUser Data\\033[0;35m :++++++++++++++++++++<br \/>\n+  \\033[0;37mUsername \\033[0;35m= \\033[1;32m`whoami`<br \/>\n\\033[0;35m+ \\033[0;37mPrivlages \\033[0;35m= \\033[1;32m$PRIVLAGED<br \/>\n\\033[0;35m+  \\033[0;37mSessions \\033[0;35m= \\033[1;32m`who | grep $USER | wc -l` of $ENDSESSION MAX<br \/>\n\\033[0;35m+ \\033[0;37mProcesses \\033[0;35m= \\033[1;32m$PROCCOUNT of `ulimit -u` MAX<br \/>\n\\033[0;35m+++++++++++++: \\033[0;37mHelpful Information\\033[0;35m :+++++++++++++++<br \/>\n\\033[0;35m+\\033[0;37mcharge UPS \\033[0;35m= \\033[1;32m`upsc UPS@fred-nas|sed '\/^battery.charge:  *\/!d; s\/\/\/;q'` %<br \/>\n\\\\033[0;39m\"<br \/>\n<\/code><\/p>\n<p>on ajout la ligne Dans le fichier<br \/>\n<code><br \/>\n\/etc\/fichier<br \/>\n<\/code><\/p>\n<p>On y ajoute \u00e0 la fin la ligne:<br \/>\n<code><br \/>\n\/usr\/local\/bin\/dynmotd<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>On cr\u00e9e le fichier: \/usr\/local\/bin\/dynmotd On y insert les lignes suivante: #!\/bin\/bash PROCCOUNT=`ps -l | wc -l` PROCCOUNT=`expr $PROCCOUNT &#8211; 4` if [[ $(groups) == *irc* ]]; then ENDPROC=`cat \/etc\/security\/limits.conf | grep \u00ab\u00a0@irc\u00a0\u00bb | grep nproc | awk &lsquo;print $4&rsquo;` ENDSESSION=`cat \/etc\/security\/limits.conf | grep \u00ab\u00a0@irc\u00a0\u00bb | grep maxlogins | awk &lsquo;print $4&rsquo;` PRIVLAGED=\u00a0\u00bbIRC Account\u00a0\u00bb else [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-181","post","type-post","status-publish","format-standard","hentry","category-poweredge-t105"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/fredptitgars.ovh\/index.php?rest_route=\/wp\/v2\/posts\/181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fredptitgars.ovh\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fredptitgars.ovh\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fredptitgars.ovh\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/fredptitgars.ovh\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=181"}],"version-history":[{"count":0,"href":"https:\/\/fredptitgars.ovh\/index.php?rest_route=\/wp\/v2\/posts\/181\/revisions"}],"wp:attachment":[{"href":"https:\/\/fredptitgars.ovh\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fredptitgars.ovh\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fredptitgars.ovh\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}