Commit a10a8e63 authored by Theodor-Adrian Stana's avatar Theodor-Adrian Stana

sw-rtm: Changes to rename script

Same as two commits back for the FM PTS.
parent e8702ab3
......@@ -106,4 +106,3 @@ SFP_DPRAM_OFS = 0x600
# Pulse counter base address
PULSE_CNT_BASE = 0xc00
......@@ -4,35 +4,35 @@ import sys
from subprocess import *
from string import Template
sys.argv[1] = sys.argv[1].lower()
try:
with open("ubuntu/%s/pyts/ptsdefine.py" % (sys.argv[1]), "r+") as f:
sys.argv[1] = sys.argv[1].lower()
with open("ubuntu/%s/pyts/ptsdefine.py" % (sys.argv[1]), "r") as f:
buf = f.read()
buf = Template(buf)
buf = buf.substitute(BOARD=sys.argv[1], ELMAIP=sys.argv[2], ELMAPWD=sys.argv[3], ELMASLOT=sys.argv[4])
f.seek(0)
with open("ubuntu/%s/pyts/ptsdefine.py" % (sys.argv[1]), "w") as f:
f.write(buf)
with open("ubuntu/%s/shell/get-fan-speeds" % (sys.argv[1]), "r+") as f:
with open("ubuntu/%s/shell/get-fan-speeds" % (sys.argv[1]), "r") as f:
buf = f.read()
buf = Template(buf)
buf = buf.substitute(ELMAIP=sys.argv[2], ELMAPWD=sys.argv[3])
f.seek(0)
with open("ubuntu/%s/shell/get-fan-speeds" % (sys.argv[1]), "w") as f:
f.write(buf)
with open("ubuntu/%s/shell/men-on" % (sys.argv[1]), "r+") as f:
with open("ubuntu/%s/shell/men-on" % (sys.argv[1]), "r") as f:
buf = f.read()
buf = Template(buf)
buf = buf.substitute(ELMAIP=sys.argv[2], ELMAPWD=sys.argv[3])
f.seek(0)
with open("ubuntu/%s/shell/men-on" % (sys.argv[1]), "w") as f:
f.write(buf)
with open("ubuntu/%s/shell/men-off" % (sys.argv[1]), "r+") as f:
with open("ubuntu/%s/shell/men-off" % (sys.argv[1]), "r") as f:
buf = f.read()
buf = Template(buf)
buf = buf.substitute(ELMAIP=sys.argv[2], ELMAPWD=sys.argv[3])
f.seek(0)
with open("ubuntu/%s/shell/men-off" % (sys.argv[1]), "w") as f:
f.write(buf)
except IndexError:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment