diff options
| author | Roy Marples <roy@marples.name> | 2008-08-14 11:00:58 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2008-08-14 11:00:58 +0000 |
| commit | fb8c0fd4b0d1ac58474f42f7bfc8c4398a954d83 (patch) | |
| tree | ea2d6b8d92c9dacfafc8660471fc61b148cfae58 /dhcpcd-run-hooks.in | |
| parent | b78ebc2f4c93e0a0b93a839e65d70c331d8134b7 (diff) | |
| download | dhcpcd-fb8c0fd4b0d1ac58474f42f7bfc8c4398a954d83.tar.xz | |
Move uniqify to dhcpcd-run-hooks
Diffstat (limited to 'dhcpcd-run-hooks.in')
| -rw-r--r-- | dhcpcd-run-hooks.in | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/dhcpcd-run-hooks.in b/dhcpcd-run-hooks.in index 2672c852..aed2d2db 100644 --- a/dhcpcd-run-hooks.in +++ b/dhcpcd-run-hooks.in @@ -7,6 +7,21 @@ signature="${signature_base}${interface}" signature_base_end="# End of dhcpcd from " signature_end="${signature_base_end}${interface}" +# Ensure that all arguments are unique +uniqify() +{ + local result= + + while [ -n "$1" ]; do + case " ${result} " in + *" $1 "*);; + *) result="${result}${result:+ }$1";; + esac + shift + done + echo "${result}" +} + # Clean a configuration file of our current signature and stale ones clean_conf() { |
