Run "opkg save" from LuCi commands (opkg extras)

Hi all, hi @vgaetera

I like the opkg extras to manage the packages but I missed an option to run opkg save from Webinterface. So I installed LuCi commands plugin and try to execute opkg save from there but it does not work. The command can be executed only from shell. I tried to run opkg.sh from profile.d folder but there are no execution rights. Before I break something I want to ask what is the best way to run opkg save from Web GUI.

Cheers,
Nils

1 Like
opkg update
opkg install luci-app-commands
/etc/init.d/rpcd restart
cat << "EOF" > /usr/bin/opkg-extras
#!/bin/sh
. /etc/profile.d/opkg.sh
opkg "${@}"
EOF
chmod +x /usr/bin/opkg-extras
cat << EOF >> /etc/sysupgrade.conf
/usr/bin/opkg-extras
EOF
uci -q delete luci.opkg_update
uci set luci.opkg_update="command"
uci set luci.opkg_update.command="opkg update"
uci set luci.opkg_update.name="Update Opkg lists"
uci -q delete luci.opkg_save
uci set luci.opkg_save="command"
uci set luci.opkg_save.command="opkg-extras save"
uci set luci.opkg_save.name="Save Opkg profile"
uci -q delete luci.opkg_restore
uci set luci.opkg_restore="command"
uci set luci.opkg_restore.command="opkg-extras restore"
uci set luci.opkg_restore.name="Restore Opkg profile"
uci -q delete luci.opkg_rollback
uci set luci.opkg_rollback="command"
uci set luci.opkg_rollback.command="opkg-extras rollback"
uci set luci.opkg_rollback.name="Rollback Opkg profile"
uci commit luci
4 Likes

Perfect. You should add this to the Wiki page. Would be very helpful to save the profile directly after installing a package via Luci. :slight_smile:

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.