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@archlinux ~]$ test -e /dev/sdz1; echo $?
1
[rocketmouse@archlinux ~]$ test -e /dev/sda1; echo $?
0
[rocketmouse@archlinux ~]$ if [ -e /dev/sdz1 ]; then echo "mount && cp"; fi
[rocketmouse@archlinux ~]$ if [ -e /dev/sda1 ]; then echo "mount && cp"; fi
mount && cp
[rocketmouse@archlinux ~]$
--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/ubuntu-users