#!/bin/sh # Name: Install Kho Sách # Author: mnd.vn # # One-tap installer: registers the MND package repository with KPM and # installs (or updates) Kho Sách from it. Copy this single file into the # Kindle's documents/ folder, eject, and tap it on the home screen. # # Tapping it again later upgrades to whatever version the repository # currently offers, so it doubles as the update button. # # It needs KPM, which modern jailbreaks (hdnext / jb.sh) install as part of # the hotfix, and Wi-Fi. Deliberately NOT marked DontUseFBInk: KPM's own # progress output is what the user should see while it works. REPO=https://kpm.mnd.vn/r LOG=/mnt/us/khosach-install.log # KPM's path differs between jailbreak generations, so look rather than # assume, and say so plainly when it isn't there -- "command not found" on # a Kindle screen explains nothing. KPM="" for candidate in /var/local/kmc/bin/kpm /mnt/us/kmc/bin/kpm $(command -v kpm 2>/dev/null); do if [ -x "$candidate" ]; then KPM=$candidate break fi done { date if [ -z "$KPM" ]; then echo "KPM was not found on this Kindle." echo "Kho Sách installs through KPM, which comes with current" echo "jailbreak setups (hdnext / jb.sh and the Universal Hotfix)." echo "Install KPM first, or use the manual .zip instead:" echo " https://kpm.mnd.vn/" exit 1 fi echo "Using $KPM" echo "Adding repository $REPO" "$KPM" -y add-repo "$REPO" echo "Installing Kho Sách" if "$KPM" -y install khosach; then echo echo "Done. Tap \"Kho Sách\" on the home screen." echo "Catalogs are configured in extensions/opds/feeds.conf." else echo echo "Install failed. Check Wi-Fi is on, then tap this again." echo "Details are in $LOG" exit 1 fi } 2>&1 | tee "$LOG"