Sponsored Content
Full Discussion: help
Top Forums Shell Programming and Scripting help Post 302092912 by ghostdog74 on Friday 13th of October 2006 07:54:59 AM
Old 10-13-2006
In Python

Code:
data = open("file.txt").read()
amt, famt = data.split("=") # amt = FACT_AMT, famt = FACT_AMT_16
famt_num = int(famt[-2:]) + 1 #add the last num, eg 16 + 1
newfamt = famt[:-2] + str(famt_num) + "-" + famt # eg FACT_AMT_17-FACT_AMT_16
o = open("file.txt" ,"w") #open file for replacing
print >> o , amt + "=" + newfamt

output:
Code:
FACT_AMT=FACT_AMT_17-FACT_AMT_16

 
amttool(1)						      General Commands Manual							amttool(1)

NAME
amttool - remotely control Intel AMT managed machines. SYNOPSIS
amttool host [ command ] [ arg(s) ] DESCRIPTION
amttool is a perl script which speaks SOAP to Intel AMT managed machines. It can query informations about the machine in question and also send some commands for basic remote control. host is the hostname or IP address of the machine amttool should control. command is an optional command. You must set fill AMT_PASSWORD environment variable with the AMT password. For more inforamtions on Intel AMT check amt-howto(7). COMMANDS
info gather information (default). reset [ special ] reset machine, with optional special command (see section below). powerup [ special ] turn on machine. powerdown turn off machine. powercycle [ special ] powercycle machine. netinfo print network configuration (requires AMT 2.5+). netconf if link [ ip mask gw [ dns1 [ dns2 ]]] configure network interface (requires AMT 2.5+). if is the interface handle, link the link policy. If in doubt just feed in what the netinfo command prints. ip is the IPv4 address, mask the netmask, gw the default gateway, dns1 and dns2 are the DNS Servers. If no IP configuration is specified the tool tries to configure the machine in shared mac address mode with dhcp, otherwise in sepa- rate mac address mode with static IP address. Default for dns1 is the gateway address, for dns2 it is 0.0.0.0. SPECIAL COMMANDS
Special commands can optionally be specified for reset, powerup and powercycle. They change the default boot behavior of the machine. bios Asks for the BIOS boot messages being redirected to serial-over-lan. pxe Network boot via PXE. hd Boot from local disk. hdsafe Boot from local disk (safe mode). cd Boot from CD/DVD. diag Boot in diagnostics mode. ENVIRONMENT
AMT_PASSWORD AMT password. AMT_DEBUG Enable debug output. SEE ALSO
amtterm(1), gamt(1), amt-howto(7) AUTHOR
(c) 2007 Gerd Hoffmann <kraxel@redhat.com> (c) 2007,08 Gerd Hoffmann amttool(1)
All times are GMT -4. The time now is 12:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy