
#########
## /usr/sys/master.d/gentty
#########

set `grep "^NUMDISC=" /usr/sys/master.d/gentty | tr '=' ' '`
linecnt=`expr $2`
mvwcnt=`expr $2 - 1`

echo "Editing system configuration files"

grep mvw /usr/sys/master.d/gentty >> errorlog 2>&1

if [ $? = 0 ]
  then
    echo "  /usr/sys/master.d/gentty........................\c"

    ed /usr/sys/master.d/gentty >> errorlog 2>&1 << EOF
/linesw(%l/
+
d
/mvwin/
-
.,+8d
/^NUMDISC=/
s/$linecnt/$mvwcnt/
w
EOF

    if [ $? != 0 ]
      then
        echo "ERROR\n  Can't save changes."
        exit 1
    fi

    echo "OK"
fi

exit 0
