]> Keep plugins and boot packages installed but not loaded at boot, and load them on demand. Adds a Parking tab and a Boot Packages tab to the Plugins page. for pkg in /var/log/packages/&name;-*; do if [ -e "$pkg" ]; then removepkg "$(basename "$pkg")" >/dev/null 2>&1; fi done exit 0 &pluginURL; &sha256; mkdir -p /boot/config/plugins/&name; # installpkg keeps whatever modes the archive had, so set them here chown -R root:root /usr/local/emhttp/plugins/&name; chmod -R 755 /usr/local/emhttp/plugins/&name; find /usr/local/emhttp/plugins/&name; -type f -exec chmod 644 {} \; chmod 755 /usr/local/emhttp/plugins/&name;/event/started # a reminder for un-get users (un-get cannot see parked packages); only does anything in an interactive # bash shell when un-get is installed and something is parked. Slackware only sources executable profile.d files. cp /usr/local/emhttp/plugins/&name;/scripts/un-get-reminder.sh /etc/profile.d/&name;.sh chown root:root /etc/profile.d/&name;.sh chmod 755 /etc/profile.d/&name;.sh rm -f $(ls /boot/config/plugins/&name;/&name;-*.txz 2>/dev/null | grep -v "&version;") echo "Plugin Parking &version; installed. Open the Plugins page and look for the Parking and Boot Packages tabs." PARKED=/boot/config/plugins-parked XPARKED=/boot/extra-parked STATE=/boot/config/plugins/&name; np=$(ls "$PARKED"/*.plg 2>/dev/null | wc -l) nk=$(ls "$XPARKED"/*.txz "$XPARKED"/*.tgz "$XPARKED"/*.tbz "$XPARKED"/*.tlz 2>/dev/null | wc -l) if [ "$np" -gt 0 ] || [ "$nk" -gt 0 ]; then choice="" [ -f "$STATE/remove-decision" ] && choice=$(tr -d '[:space:]' < "$STATE/remove-decision") if [ -z "$choice" ] && [ -t 0 ]; then read -r -p $'You have '"$np"$' parked plugin(s) and '"$nk"$' parked package(s).\n 1) Move them back so they load at every boot again (recommended)\n 2) Keep them parked (they will not load at boot)\nChoose 1 or 2 [1]: ' ans if [ "$ans" = "2" ]; then choice=keep; else choice=restore; fi fi if [ "$choice" != "keep" ]; then [ -z "$choice" ] && echo "No choice was recorded, so the parked items are being moved back rather than left where nothing will load them." php -r 'require "/usr/local/emhttp/plugins/&name;/include/lib.php"; $m = pp_restore_all(pp_paths()); echo "Moved back to the normal locations: ".$m["plugins"]." plugin(s), ".$m["packages"]." package(s).\n"; if (count($m["skipped"])) echo "Left parked because a file with the same name already exists: ".implode(", ", $m["skipped"])."\n";' || echo "Could not move the parked items back. They are still in $PARKED and $XPARKED." else echo "Keeping the parked items where they are. They will not load at boot. To load one by hand:" echo " plugin install $PARKED/NAME.plg" echo " upgradepkg --install-new $XPARKED/NAME.txz" fi fi rm -f "$STATE/remove-decision" rm -f /etc/profile.d/&name;.sh rm -f /boot/config/plugins/&name;/&name;-*.txz # Unraid does not forget the package on its own: without this, reinstalling the same # version before a reboot is skipped as "already installed" and installs nothing for pkg in /var/log/packages/&name;-*; do [ -e "$pkg" ] && removepkg "$(basename "$pkg")" >/dev/null 2>&1 done rm -rf /usr/local/emhttp/plugins/&name;