#!/bin/sh # Install luci-app-copyparty onto an OpenWrt device. # Run on the device itself, or adapt for scp. set -e DEST_INIT=/etc/init.d/copyparty DEST_UCI=/etc/config/copyparty DEST_VIEW=/www/luci-static/resources/view/copyparty.js DEST_MENU=/usr/share/luci/menu.d/luci-app-copyparty.json DEST_ACL=/usr/share/rpcd/acl.d/luci-app-copyparty.json SCRIPT_DIR=$(dirname "$0") cp "$SCRIPT_DIR/etc/init.d/copyparty" "$DEST_INIT" chmod +x "$DEST_INIT" [ -f "$DEST_UCI" ] || cp "$SCRIPT_DIR/etc/config/copyparty" "$DEST_UCI" cp "$SCRIPT_DIR/www/luci-static/resources/view/copyparty.js" "$DEST_VIEW" cp "$SCRIPT_DIR/usr/share/luci/menu.d/luci-app-copyparty.json" "$DEST_MENU" cp "$SCRIPT_DIR/usr/share/rpcd/acl.d/luci-app-copyparty.json" "$DEST_ACL" /etc/init.d/rpcd restart echo "Installed. Edit $DEST_UCI then: /etc/init.d/copyparty enable && /etc/init.d/copyparty start"