Skip to content

Commit

Permalink
Append newline when reading in settings
Browse files Browse the repository at this point in the history
Some sed implementations, like that on Solaris, don't process lines which don't end in EOL/newline. Forcing a newline helps these versions.
  • Loading branch information
lildude committed Dec 12, 2014
1 parent fc8d2d8 commit a826aca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions share/github-backup-utils/ghe-restore-settings
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ GHE_RESTORE_SNAPSHOT_PATH="$GHE_DATA_DIR/$GHE_RESTORE_SNAPSHOT"
echo "Restoring settings ..."
if [ "$GHE_VERSION_MAJOR" -ge 2 ]; then
# work around issue importing settings with bad storage mode values
cat "$GHE_RESTORE_SNAPSHOT_PATH/settings.json" |
( cat "$GHE_RESTORE_SNAPSHOT_PATH/settings.json" && echo ) |
sed 's/"storage_mode": "device"/"storage_mode": "rootfs"/' |
ghe-ssh "$GHE_HOSTNAME" -- '/usr/bin/env GHEBUVER=2 ghe-import-settings' 1>&3
else
cat "$GHE_RESTORE_SNAPSHOT_PATH/settings.json" |
( cat "$GHE_RESTORE_SNAPSHOT_PATH/settings.json" && echo ) |
ghe-ssh "$GHE_HOSTNAME" -- '/usr/bin/env GHEBUVER=2 ghe-import-settings' 1>&3
fi

Expand Down

0 comments on commit a826aca

Please sign in to comment.