fix wrong configuration script order

This commit is contained in:
oiseauroch
2022-10-10 21:38:11 +02:00
parent 2656a675a4
commit a37de1795c
3 changed files with 40 additions and 39 deletions

View File

@@ -216,6 +216,42 @@ ynh_store_file_checksum --file="/etc/nginx/conf.d/$domain.conf"
# ...
#=================================================
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..." --time --weight=1
### You can add specific configuration files.
###
### Typically, put your template conf file in ../conf/your_config_file
### The template may contain strings such as __FOO__ or __FOO_BAR__,
### which will automatically be replaced by the values of $foo and $foo_bar
###
### ynh_add_config will also keep track of the config file's checksum,
### which later during upgrade may allow to automatically backup the config file
### if it's found that the file was manually modified
###
### Check the documentation of `ynh_add_config` for more info.
ynh_add_config --template="mount_disk.sh" --destination="$final_path/mount_disk.sh"
ynh_add_config --template="umount_disk.sh" --destination="$final_path/umount_disk.sh"
ynh_add_config --template="garage.toml" --destination="$final_path/garage.toml"
chmod +x "$final_path/mount_disk.sh" "$final_path/umount_disk.sh"
# FIXME: this should be handled by the core in the future
# You may need to use chmod 600 instead of 400,
# for example if the app is expected to be able to modify its own config
chmod 600 "$final_path/garage.toml"
chown $app:$app "$final_path/garage.toml"
### For more complex cases where you want to replace stuff using regexes,
### you shoud rely on ynh_replace_string (which is basically a wrapper for sed)
### When doing so, you also need to manually call ynh_store_file_checksum
###
### ynh_replace_string --match_string="match_string" --replace_string="replace_string" --target_file="$final_path/some_config_file"
### ynh_store_file_checksum --file="$final_path/some_config_file"
#=================================================
# CREATE DATA DIRECTORY
#=================================================
@@ -259,40 +295,6 @@ if [ "$virtualisation" = "true" ]
then
$final_path/umount_disk.sh $nbd_index
fi
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..." --time --weight=1
### You can add specific configuration files.
###
### Typically, put your template conf file in ../conf/your_config_file
### The template may contain strings such as __FOO__ or __FOO_BAR__,
### which will automatically be replaced by the values of $foo and $foo_bar
###
### ynh_add_config will also keep track of the config file's checksum,
### which later during upgrade may allow to automatically backup the config file
### if it's found that the file was manually modified
###
### Check the documentation of `ynh_add_config` for more info.
ynh_add_config --template="mount_disk.sh" --destination="$final_path/mount_disk.sh"
ynh_add_config --template="umount_disk.sh" --destination="$final_path/umount_disk.sh"
ynh_add_config --template="garage.toml" --destination="$final_path/garage.toml"
chmod +x "$final_path/mount_disk.sh" "$final_path/umount_disk.sh"
# FIXME: this should be handled by the core in the future
# You may need to use chmod 600 instead of 400,
# for example if the app is expected to be able to modify its own config
chmod 600 "$final_path/garage.toml"
chown $app:$app "$final_path/garage.toml"
### For more complex cases where you want to replace stuff using regexes,
### you shoud rely on ynh_replace_string (which is basically a wrapper for sed)
### When doing so, you also need to manually call ynh_store_file_checksum
###
### ynh_replace_string --match_string="match_string" --replace_string="replace_string" --target_file="$final_path/some_config_file"
### ynh_store_file_checksum --file="$final_path/some_config_file"
#=================================================
# SETUP SYSTEMD