mirror of
https://github.com/YunoHost-Apps/timemachine_ynh.git
synced 2024-09-03 20:26:33 +02:00
59 lines
2 KiB
Bash
59 lines
2 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# CHECK VERSION
|
|
#=================================================
|
|
|
|
upgrade_type=$(ynh_check_app_version_changed)
|
|
|
|
#=================================================
|
|
# SPECIFIC UPGRADE
|
|
#=================================================
|
|
# UPDATE A CONFIG FILE
|
|
#=================================================
|
|
ynh_script_progression --message="Updating a configuration file..." --weight=1
|
|
|
|
ynh_add_config --template="smb.conf" --destination="/etc/smb/smb.d/$app.conf"
|
|
ynh_add_config --template="avahi-samba.service" --destination="/etc/avahi/services/$app.service"
|
|
|
|
samba_sysadmin_update
|
|
samba_sysadmin_add
|
|
|
|
#=================================================
|
|
# OPEN PORT 445
|
|
#=================================================
|
|
ynh_script_progression --message="Configuring firewall..." --weight=1
|
|
|
|
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP 445 # Allow SMB access
|
|
|
|
#=================================================
|
|
# GENERIC FINALIZATION
|
|
#=================================================
|
|
# INTEGRATE SERVICE IN YUNOHOST
|
|
#=================================================
|
|
ynh_script_progression --message="Integrating service in YunoHost..."
|
|
|
|
yunohost service add smbd --needs_exposed_ports 445
|
|
|
|
#=================================================
|
|
# START SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression --message="Starting a systemd service..."
|
|
|
|
ynh_systemd_action --service_name=smbd --action="reload"
|
|
ynh_systemd_action --service_name=avahi-daemon --action="restart"
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Upgrade of $app completed" --last
|