From 759e5dcf5dbdb031f61de41a77a9df9795251e82 Mon Sep 17 00:00:00 2001 From: billz Date: Wed, 25 Dec 2024 18:57:59 -0800 Subject: [PATCH] Add _create_plugin_scripts() --- installers/common.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/installers/common.sh b/installers/common.sh index 472058d9..bd78ef00 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -51,6 +51,7 @@ function _install_raspap() { _download_latest_files _change_file_ownership _create_hostapd_scripts + _create_plugin_scripts _create_lighttpd_scripts _install_lighttpd_configs _default_configuration @@ -298,6 +299,19 @@ function _create_hostapd_scripts() { _install_status 0 } +# Generate plugin helper scripts +function _create_plugin_scripts() { + _install_log "Creating plugin helper scripts" + sudo mkdir $raspap_dir/plugins || _install_status 1 "Unable to create directory '$raspap_dir/plugins'" + + # Copy plugin helper script + sudo cp "$webroot_dir/installers/"plugin_helper.sh "$raspap_dir/plugins" || _install_status 1 "Unable to move plugin script" + # Change ownership and permissions of plugin script + sudo chown -c root:root "$raspap_dir/plugins/"*.sh || _install_status 1 "Unable change owner and/or group" + sudo chmod 750 "$raspap_dir/plugins/"*.sh || _install_status 1 "Unable to change file permissions" + _install_status 0 +} + # Generate lighttpd service control scripts function _create_lighttpd_scripts() { _install_log "Creating lighttpd control scripts"