3

I am editing an Arch base installation script. I almost got it to work as I wanted!

I need to add the following into the end of /etc/pacman.conf

[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch

Before I used cat command and it deleted everything inside /etc/pacman.conf and just added this. But I need to add it to the end of the file.

Here is the script I currently have: https://github.com/ArchT420/T420/blob/master/installer.sh

Thank you!

jasonwryan
  • 73,126
Spacecow
  • 203

2 Answers2

7

This solution seems to work:

#!/bin/bash


## Add AUR repository in /etc/pacman.conf
cat <<EOF >> /mnt/etc/pacman.conf
[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/\$arch
EOF
Spacecow
  • 203
0

Why don't we simply use echo to append the context to a file.

echo -e '[archlinuxfr]\nSigLevel = Never\nServer = http://repo.archlinux.fr/$arch' >> /home/user/Documents/pacman.conf
Siva
  • 9,077