<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: scripting help...please in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-please/m-p/4880057#M400313</link>
    <description>hi,&lt;BR /&gt;&lt;BR /&gt;Sorry about the previous post.&lt;BR /&gt;&lt;BR /&gt;try this,&lt;BR /&gt;&lt;BR /&gt;if [ -f /etc/maintenance_mode ]&lt;BR /&gt;then&lt;BR /&gt;if [ "$LOGNAME" != "root" ]&lt;BR /&gt;then&lt;BR /&gt;echo " System down for maint "&lt;BR /&gt;exit 1&lt;BR /&gt;fi&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Regds&lt;BR /&gt;</description>
    <pubDate>Thu, 13 Jan 2005 18:07:29 GMT</pubDate>
    <dc:creator>Sanjay_6</dc:creator>
    <dc:date>2005-01-13T18:07:29Z</dc:date>
    <item>
      <title>scripting help...please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-please/m-p/4880054#M400310</link>
      <description>Hi,..hpux11.11v1, rp2470&lt;BR /&gt;&lt;BR /&gt;My aim is to restrict login via startup script. This is what I have written into the /etc/profile:&lt;BR /&gt;if [ -r /etc/maintenance_mode ]&lt;BR /&gt;  then&lt;BR /&gt;   if [ $LOGNAME != root ]&lt;BR /&gt;   echo " System down for maint "&lt;BR /&gt;   then&lt;BR /&gt;   exit 1&lt;BR /&gt;   fi&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;This is supposed to let only root login, and no other users (when attempting logging in with posix/bourne sh, but this is actually stopping ALL users including root from logging in.&lt;BR /&gt;Anyone see where I am going wrong.  Help much appreciated and lotsa points floating around.&lt;BR /&gt;thanks heaps&lt;BR /&gt;Maria</description>
      <pubDate>Thu, 13 Jan 2005 17:54:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-please/m-p/4880054#M400310</guid>
      <dc:creator>Peter Gillis</dc:creator>
      <dc:date>2005-01-13T17:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: scripting help...please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-please/m-p/4880055#M400311</link>
      <description>Hi Maria,&lt;BR /&gt;&lt;BR /&gt;Try this,&lt;BR /&gt;&lt;BR /&gt;if [ -f /etc/maintenance_mode ]&lt;BR /&gt;then&lt;BR /&gt;if [ "$LOGNAME" != "root" ]&lt;BR /&gt;echo " System down for maint "&lt;BR /&gt;then&lt;BR /&gt;exit 1&lt;BR /&gt;fi&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;hope this helps.&lt;BR /&gt;&lt;BR /&gt;regds&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Jan 2005 17:58:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-please/m-p/4880055#M400311</guid>
      <dc:creator>Sanjay_6</dc:creator>
      <dc:date>2005-01-13T17:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: scripting help...please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-please/m-p/4880056#M400312</link>
      <description>You are doing this the hard way. Edit /etc/default/security and add this line:&lt;BR /&gt;NOLOGIN=1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Now, when the file /etc/nologin exists only root can login; all other users receive a message from login that they are not allowed to login.&lt;BR /&gt;&lt;BR /&gt;When maintenance mode is finished, simply remove or rename /etc/nologin. You don't need to do any scripting because login will handle it for you.&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Jan 2005 18:05:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-please/m-p/4880056#M400312</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-01-13T18:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: scripting help...please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-please/m-p/4880057#M400313</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;Sorry about the previous post.&lt;BR /&gt;&lt;BR /&gt;try this,&lt;BR /&gt;&lt;BR /&gt;if [ -f /etc/maintenance_mode ]&lt;BR /&gt;then&lt;BR /&gt;if [ "$LOGNAME" != "root" ]&lt;BR /&gt;then&lt;BR /&gt;echo " System down for maint "&lt;BR /&gt;exit 1&lt;BR /&gt;fi&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Regds&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Jan 2005 18:07:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-please/m-p/4880057#M400313</guid>
      <dc:creator>Sanjay_6</dc:creator>
      <dc:date>2005-01-13T18:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: scripting help...please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-please/m-p/4880058#M400314</link>
      <description>Sanjay,&lt;BR /&gt;thanks for quick reply.Unfortuneately I get exactly the same result....any more suggestions???&lt;BR /&gt;thanks, Maria</description>
      <pubDate>Thu, 13 Jan 2005 18:09:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-please/m-p/4880058#M400314</guid>
      <dc:creator>Peter Gillis</dc:creator>
      <dc:date>2005-01-13T18:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: scripting help...please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-please/m-p/4880059#M400315</link>
      <description>Your script has an error&lt;BR /&gt; &lt;BR /&gt;if [ $LOGNAME != root ]&lt;BR /&gt;echo " System down for maint "&lt;BR /&gt;then&lt;BR /&gt; &lt;BR /&gt;You should have this instead-&lt;BR /&gt; &lt;BR /&gt;if [ $LOGNAME != root ]&lt;BR /&gt;then&lt;BR /&gt;echo " System down for maint "&lt;BR /&gt; &lt;BR /&gt;"then" should be right after the "if"&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Thu, 13 Jan 2005 18:29:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-please/m-p/4880059#M400315</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-01-13T18:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: scripting help...please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-please/m-p/4880060#M400316</link>
      <description>Thanks all.&lt;BR /&gt;I have tested both methods, and they are working for us.&lt;BR /&gt;with the /etc/profile script I had to also put the spaces between the [ and " , then all worked ok.  &lt;BR /&gt;Thanks Clay, for the nologin info - this appears to be the way to go for notifying ( and kicking off) all types of shell users.&lt;BR /&gt;Maria.</description>
      <pubDate>Thu, 13 Jan 2005 18:51:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-please/m-p/4880060#M400316</guid>
      <dc:creator>Peter Gillis</dc:creator>
      <dc:date>2005-01-13T18:51:05Z</dc:date>
    </item>
  </channel>
</rss>

