diff options
author | Karel Kočí <cynerd@email.cz> | 2020-07-23 17:20:09 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2020-07-23 17:20:09 +0200 |
commit | b99c4d1af4ee509b4299b081fb222d33eafe8e39 (patch) | |
tree | 49d2ffc87444168c6c0f484e0e3a37e1bee4537b /base64c/files/update_alternatives.sh | |
parent | ee24ad882119908409137de5ac753895bc948cc6 (diff) | |
download | openwrt-personal-pkgs-b99c4d1af4ee509b4299b081fb222d33eafe8e39.tar.gz openwrt-personal-pkgs-b99c4d1af4ee509b4299b081fb222d33eafe8e39.tar.bz2 openwrt-personal-pkgs-b99c4d1af4ee509b4299b081fb222d33eafe8e39.zip |
base64c: add new package
Diffstat (limited to 'base64c/files/update_alternatives.sh')
-rwxr-xr-x | base64c/files/update_alternatives.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/base64c/files/update_alternatives.sh b/base64c/files/update_alternatives.sh new file mode 100755 index 0000000..c93ae45 --- /dev/null +++ b/base64c/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 |