diff options
| author | Roy Marples <roy@marples.name> | 2009-02-26 19:31:41 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2009-02-26 19:31:41 +0000 |
| commit | e0dd8b7e4a3011200972a9103d84081aca91843f (patch) | |
| tree | 967389de1578a2fd38d53fa203c791bb58be98d7 /dhcpcd-run-hooks.in | |
| parent | f68268b72b6372fd3c0ba2be78cbecbe8ceab98c (diff) | |
| download | dhcpcd-e0dd8b7e4a3011200972a9103d84081aca91843f.tar.xz | |
Use state dir for tmp files and try to preserve orig file more.
Diffstat (limited to 'dhcpcd-run-hooks.in')
| -rw-r--r-- | dhcpcd-run-hooks.in | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/dhcpcd-run-hooks.in b/dhcpcd-run-hooks.in index da37b5df..ca8fe94a 100644 --- a/dhcpcd-run-hooks.in +++ b/dhcpcd-run-hooks.in @@ -114,17 +114,17 @@ change_file() save_conf() { if [ -f "$1" ]; then - rm -f "$1"-pre."${interface}" - mv -f "$1" "$1"-pre."${interface}" + rm -f "${1}-pre.${interface}" + cat "$1" > "${1}-pre.${interface}" fi } # Restore a config file restore_conf() { - [ -f "$1"-pre."${interface}" ] || return 1 - rm -f "$1" - mv -f "$1"-pre."${interface}" "$1" + [ -f "${1}-pre.${interface}" ] || return 1 + cat "${1}-pre.${interface}" > "$1" + rm -f "${1}-pre.${interface}" } |
