diff options
author | P. J. McDermott <pjm@nac.net> | 2014-02-19 19:26:58 (EST) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2014-02-19 19:26:58 (EST) |
commit | ceef092839b88b388a77190ba3bd0a331e5ff9e7 (patch) | |
tree | 0cb0550ddd824c8da363f3daa94cf1c1ef1771b0 /busybox.pkg/prerm | |
parent | 8e3ec3ad08dfdf18151e01fd23a9d33b6e9c20f4 (diff) |
Refactor update-alternatives stuff into loops.
Diffstat (limited to 'busybox.pkg/prerm')
-rwxr-xr-x | busybox.pkg/prerm | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/busybox.pkg/prerm b/busybox.pkg/prerm index 63b465e..5e7cf79 100755 --- a/busybox.pkg/prerm +++ b/busybox.pkg/prerm @@ -1,10 +1,16 @@ #!/bin/sh if [ "${1}" = remove ]; then - update-alternatives --remove awk /usr/bin/awk.busybox - update-alternatives --remove ar /usr/bin/ar.busybox - update-alternatives --remove strings /usr/bin/strings.busybox - update-alternatives --remove clear /usr/bin/clear.busybox - update-alternatives --remove reset /usr/bin/reset.busybox - update-alternatives --remove mkpasswd /usr/bin/mkpasswd.busybox + while read link name prio; do + if [ -e "${link}.busybox" ]; then + update-alternatives --remove "${name}" "${link}.busybox" + fi + done <<-EOF + /usr/bin/awk awk 10 + /usr/bin/ar ar 10 + /usr/bin/strings strings 10 + /usr/bin/clear clear 10 + /usr/bin/reset reset 10 + /usr/bin/mkpasswd mkpasswd 10 + EOF fi |