small-package/luci-app-plex/simple-install.sh

28 lines
573 B
Bash
Raw Normal View History

2023-01-20 08:48:32 +08:00
#!/bin/sh
# run in router
APPNAME=$1
2024-03-11 20:28:41 +08:00
CURR=`pwd`
2023-01-20 08:48:32 +08:00
if [ -z "${APPNAME}" ]; then
2024-03-11 20:28:41 +08:00
APPNAME=`basename "$CURR"|cut -d '-' -f 3`
fi
if [ -z "${APPNAME}" ]; then
echo "please run in luci-app-xxx paths"
exit 1
fi
if [ ! -d luasrc ]; then
echo "luasrc not found, please run in luci-app-xxx paths"
exit 1
2023-01-20 08:48:32 +08:00
fi
mkdir -p /usr/lib/lua/luci/view/${APPNAME}
cp ./luasrc/controller/${APPNAME}.lua /usr/lib/lua/luci/controller/
cp ./luasrc/view/${APPNAME}/* /usr/lib/lua/luci/view/${APPNAME}/
cp -rf ./luasrc/model/* /usr/lib/lua/luci/model/
cp -rf ./root/* /
rm -rf /tmp/luci-*