<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 16, 2021 at 12:26 PM Ralf Mardorf via ubuntu-users <<a href="mailto:ubuntu-users@lists.ubuntu.com">ubuntu-users@lists.ubuntu.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sat, 16 Jan 2021 09:25:03 -0500, Jerry Geis wrote:<br>
>I am trying to write some commands in the early-commands section that<br>
>needs to check if /dev/sda1 exists, if so mount it , cp off<br>
>/etc/sysconfig/network-scripts/ifcfg-eth to /target/root/ifcfg-eth0<br>
<br>
IIUC "early-commands" are shell commands? If so, then just use the<br>
shell command "if" ("test").<br>
<br>
[rocketmouse@archlinux ~]$ test -e /dev/sdz1; echo $?<br>
1<br>
[rocketmouse@archlinux ~]$ test -e /dev/sda1; echo $?<br>
0<br>
[rocketmouse@archlinux ~]$ if [ -e /dev/sdz1 ]; then echo "mount && cp"; fi<br>
[rocketmouse@archlinux ~]$ if [ -e /dev/sda1 ]; then echo "mount && cp"; fi<br>
mount && cp<br>
[rocketmouse@archlinux ~]$<br>
<br>
-- <br>
ubuntu-users mailing list<br>
<a href="mailto:ubuntu-users@lists.ubuntu.com" target="_blank">ubuntu-users@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-users" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-users</a></blockquote><div><br></div><div><br></div><div><br></div><div>Thanks Ralf!</div><div><br></div><div>Jerry </div></div></div>