diff options
author | Karel Kočí <cynerd@email.cz> | 2022-01-26 13:53:47 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2022-01-26 13:53:47 +0100 |
commit | 7aaa211601597aee58e56d99cf8530a7ba52d80c (patch) | |
tree | 31d4278dda402272c95692cda8a5ce162951e96e /updater-ng/files/update_alternatives.sh | |
parent | 53aaeee4bbdb41453d40563ad228ae2dccfcc7e6 (diff) | |
download | openwrt-personal-pkgs-7aaa211601597aee58e56d99cf8530a7ba52d80c.tar.gz openwrt-personal-pkgs-7aaa211601597aee58e56d99cf8530a7ba52d80c.tar.bz2 openwrt-personal-pkgs-7aaa211601597aee58e56d99cf8530a7ba52d80c.zip |
updater-ng: test update to 70.0.0
Diffstat (limited to 'updater-ng/files/update_alternatives.sh')
-rwxr-xr-x | updater-ng/files/update_alternatives.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/updater-ng/files/update_alternatives.sh b/updater-ng/files/update_alternatives.sh new file mode 100755 index 0000000..c93ae45 --- /dev/null +++ b/updater-ng/files/update_alternatives.sh @@ -0,0 +1,23 @@ +#!/bin/sh +set -e + +if [ $# -gt 0 ]; then + echo "This script is part of updater and allows user to manually fix alternative links in system." >&2 + exit 0 +fi + +if [ ! -d /usr/lib/opkg/info ]; then + echo "OPKG info directory not located. This is OpenWrt system, isn't it?" >&2 + exit 1 +fi + +# Fist install all busybox applets and then overwite them with alternatives + +busybox --install /bin + +sed -n 's/^Alternatives://p' /usr/lib/opkg/info/*.control | \ + tr , '\n' | \ + sort -n | \ + while IFS=: read PRIO TRG SRC; do + ln -sf "$SRC" "$TRG" + done |