mirror of
https://github.com/YunoHost-Apps/kiwix_ynh.git
synced 2024-09-03 19:35:56 +02:00
Create config
This commit is contained in:
parent
aa87034ed7
commit
85b6ea1af4
1 changed files with 15 additions and 0 deletions
15
scripts/config
Normal file
15
scripts/config
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
source /usr/share/yunohost/helpers
|
||||
ynh_abort_if_errors
|
||||
|
||||
function run__upload_button() {
|
||||
local data_dir=$(ynh_app_setting_get --app=$app --key=data_dir)
|
||||
local filename="$(echo "$upload_url" | awk -F/ '{print $NF}')"
|
||||
ynh_print_info --message="Downloading file…"
|
||||
wget --tries 3 --no-dns-cache --timeout 900 --output-document="$data_dir/$filename" "$upload_url" 2>>
|
||||
ynh_print_info --message="Adding file to Kiwix library"
|
||||
$install_dir/kiwix-manage $data_dir/library.xml add "$data_dir/$filename"
|
||||
yunohost service restart kiwix
|
||||
}
|
||||
|
||||
ynh_app_config_run $1
|
Loading…
Add table
Reference in a new issue