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