Skip to content

Commit

Permalink
FreeBSD: adapt bareos-config-lib for sed
Browse files Browse the repository at this point in the history
For Darwin there was already a special sed call, which is
now also used for FreeBSD.
  • Loading branch information
pstorz committed Oct 10, 2018
1 parent 0533190 commit 9acfe89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/scripts/bareos-config-lib.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ replace()
for file in `grep -l ${SEARCH} ${DIR_CFG}/*.conf ${DIR_CFG}/bareos-*.d/*/*.conf 2>/dev/null`; do
if [ -f "$file" ]; then
echo "replacing '${SEARCH}' with '${REPLACE}' in $file"
if [ "$os_type" = "Darwin" ]; then
if [ "$os_type" = "Darwin" -o "$os_type" = "FreeBSD" ]; then
sed -i '' "s#${SEARCH}#${REPLACE}#g" "${file}"
else
sed -i'' "s#${SEARCH}#${REPLACE}#g" "${file}"
Expand Down Expand Up @@ -1044,7 +1044,7 @@ replace_password()

for file in `grep -l ${SEARCH} ${DIR_CFG}/*.conf ${DIR_CFG}/bareos-*.d/*/*.conf ${DIR_CFG}/tray-monitor.d/*/*.conf 2>/dev/null`; do
echo "replacing '${SEARCH}' in $file"
if [ "$os_type" = "Darwin" ]; then
if [ "$os_type" = "Darwin" -o "$os_type" = "FreeBSD" ]; then
sed -i '' "s#${SEARCH}#${REPLACE}#g" "${file}"
else
sed -i'' "s#${SEARCH}#${REPLACE}#g" "${file}"
Expand Down

0 comments on commit 9acfe89

Please sign in to comment.