mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-07-14 16:17:40 +02:00
Update w/ javascript support
This commit is contained in:
parent
867a46bee9
commit
6e0cf0b085
@ -77,6 +77,29 @@ case "$action" in
|
||||
echo "OK"
|
||||
;;
|
||||
|
||||
"javascript")
|
||||
[ $# -lt 2 ] && { echo "Usage: $0 javascript <source> <destination>"; exit 1; }
|
||||
|
||||
source=$1
|
||||
destination=$2
|
||||
|
||||
if [ ! -f "$source" ]; then
|
||||
echo "Source file $source does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
plugin_js_dir=$(dirname "$destination")
|
||||
if [ ! -d "$plugin_js_dir" ]; then
|
||||
mkdir -p "$plugin_js_dir"
|
||||
fi
|
||||
|
||||
cp "$source" "$destination"
|
||||
chown -R $raspap_user:$raspap_user "$plugin_js_dir"
|
||||
|
||||
echo "OK"
|
||||
;;
|
||||
|
||||
|
||||
"plugin")
|
||||
[ $# -lt 2 ] && { echo "Usage: $0 plugin <source> <destination>"; exit 1; }
|
||||
|
||||
@ -89,7 +112,7 @@ case "$action" in
|
||||
fi
|
||||
|
||||
plugin_dir=$(dirname "$destination")
|
||||
if [ ! -d "$lugin_dir" ]; then
|
||||
if [ ! -d "$plugin_dir" ]; then
|
||||
mkdir -p "$plugin_dir"
|
||||
fi
|
||||
|
||||
@ -103,11 +126,12 @@ case "$action" in
|
||||
echo "Invalid action: $action"
|
||||
echo "Usage: $0 <action> [parameters...]"
|
||||
echo "Actions:"
|
||||
echo " sudoers <file> Install a sudoers file"
|
||||
echo " packages <packages> Install aptitude package(s)"
|
||||
echo " user <name> <password> Add user non-interactively"
|
||||
echo " config <source <destination> Applies a config file"
|
||||
echo " plugin <source <destination> Copies a plugin directory"
|
||||
echo " sudoers <file> Install a sudoers file"
|
||||
echo " packages <packages> Install aptitude package(s)"
|
||||
echo " user <name> <password> Add user non-interactively"
|
||||
echo " config <source <destination> Applies a config file"
|
||||
echo " javascript <source> <destination> Applies a JavaScript file"
|
||||
echo " plugin <source <destination> Copies a plugin directory"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
Loading…
x
Reference in New Issue
Block a user