autoinstall early-commands
Jerry Geis
jerry.geis at gmail.com
Sat Jan 16 18:14:35 UTC 2021
On Sat, Jan 16, 2021 at 12:26 PM Ralf Mardorf via ubuntu-users <
ubuntu-users at lists.ubuntu.com> wrote:
> On Sat, 16 Jan 2021 09:25:03 -0500, Jerry Geis wrote:
> >I am trying to write some commands in the early-commands section that
> >needs to check if /dev/sda1 exists, if so mount it , cp off
> >/etc/sysconfig/network-scripts/ifcfg-eth to /target/root/ifcfg-eth0
>
> IIUC "early-commands" are shell commands? If so, then just use the
> shell command "if" ("test").
>
> [rocketmouse at archlinux ~]$ test -e /dev/sdz1; echo $?
> 1
> [rocketmouse at archlinux ~]$ test -e /dev/sda1; echo $?
> 0
> [rocketmouse at archlinux ~]$ if [ -e /dev/sdz1 ]; then echo "mount && cp";
> fi
> [rocketmouse at archlinux ~]$ if [ -e /dev/sda1 ]; then echo "mount && cp";
> fi
> mount && cp
> [rocketmouse at archlinux ~]$
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Thanks Ralf!
Jerry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20210116/c691ce7e/attachment.html>
More information about the ubuntu-users
mailing list