Neue Zeilen in der Datei

M

majkel-bewit

Jungspund
Hallo zusammen,

ich habe eine Konfigurationsdatei, wie z.B. von LDAP.
Code:
include         /etc/ldap/schema/cosine.schema
include         /etc/ldap/schema/nis.schema
include         /etc/ldap/schema/inetorgperson.schema

# Where the pid file is put. The init.d script
# will not stop the server if you change this.
pidfile         /var/run/slapd/slapd.pid

Ich möchte in dieser Datei zwischen zwei Zeilen, zwei neue Zeile zufügen. Es soll so aussehen:
Code:
include         /etc/ldap/schema/cosine.schema
include         /etc/ldap/schema/nis.schema
include         /etc/ldap/schema/inetorgperson.schema

include         /etc/ldap/schema/samba.schema
include         /etc/ldap/schema/postfix.schema

# Where the pid file is put. The init.d script
# will not stop the server if you change this.
pidfile         /var/run/slapd/slapd.pid

Ich wollte das ungefähr so machen:
Code:
#!/bin/sh

echo "
include         /etc/ldap/schema/samba.schema
include         /etc/ldap/schema/postfix.schema" > tmp.txt

LDAP=`cat tmp.txt`
sed -i "s/inetorgperson.schema/inetorgperson.schema${LDAP}/g" /etc/ldap/slapd.conf

Leider funktioniert es nicht. Bitte um Tips.
Bin Anfäger, also bitte nicht lachen ;-)

Danke im Voraus!
 
Hinter dem echo sollten es wenn dann schon zwei " sein...
 

Ähnliche Themen

Nginx als Reverse Proxy für Nextcloud und Emby

Zugriff Ubuntu 16.04. auf Freigabe 18.04. LTS nicht möglich

Samba 4.1.9 mit Bind 9.9.4

JBidWatcher: Problem bei loading Auctions in Verbindung mit mySQL

Red Hat Security Advisory 2012-0997-01

Zurück
Oben