sample script shufflin'
This commit is contained in:
parent
9af137c660
commit
b76ec6ccca
5
aif.xml
5
aif.xml
@ -53,5 +53,8 @@
|
||||
</software>
|
||||
</pacman>
|
||||
<bootloader type="grub" target="/boot" efi="true" />
|
||||
<script uri="https://aif.square-r00t.net/sample-scripts/pre.sh" order="1" bootstrap="1" />
|
||||
<script uri="https://aif.square-r00t.net/sample-scripts/post/first.sh" order="1" bootstrap="0" />
|
||||
<script uri="https://aif.square-r00t.net/sample-scripts/pre/second.pl" order="2" bootstrap="1" />
|
||||
<script uri="https://aif.square-r00t.net/sample-scripts/pre/first.sh" order="1" bootstrap="1" />
|
||||
<script uri="https://aif.square-r00t.net/sample-scripts/post/second.py" order="2" bootstrap="0" />
|
||||
</aif>
|
||||
|
@ -339,6 +339,7 @@ class aif(object):
|
||||
aifdict['scripts']['post'] = []
|
||||
tempscriptdict = {'pre': {}, 'post': {}}
|
||||
for x in xmlobj.find('scripts'):
|
||||
print(x.attrib['uri'])
|
||||
if all(keyname in list(x.attrib.keys()) for keyname in ('user', 'password')):
|
||||
auth = {}
|
||||
auth['user'] = x.attrib['user']
|
||||
@ -350,6 +351,7 @@ class aif(object):
|
||||
scriptcontents = self.webFetch(x.attrib['uri'], auth).decode('utf-8')
|
||||
else:
|
||||
scriptcontents = self.webFetch(x.attrib['uri']).decode('utf-8')
|
||||
print(scriptcontents)
|
||||
if x.attrib['bootstrap'].lower() in ('true', '1'):
|
||||
tempscriptdict['pre'][x.attrib['order']] = scriptcontents
|
||||
else:
|
||||
|
3
script-samples/post/second.py
Normal file
3
script-samples/post/second.py
Normal file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
print('And this is the second post script.\n')
|
6
script-samples/pre/second.pl
Normal file
6
script-samples/pre/second.pl
Normal file
@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
print "And this is the second pre (bootstrap) script.\n";
|
Loading…
Reference in New Issue
Block a user