mirror of
https://github.com/YunoHost-Apps/ssh_chroot_dir_ynh.git
synced 2024-09-03 20:26:26 +02:00
53 lines
1.6 KiB
Bash
Executable file
53 lines
1.6 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# SPECIFIC REMOVE
|
|
#=================================================
|
|
# REMOVE QUOTAS OPTIONS IN FSTAB
|
|
#=================================================
|
|
ynh_script_progression --message="Remove quotas options in fstab" --weight=3
|
|
|
|
# https://github.com/maniackcrudelis/ssh_chroot/blob/master/unix_quotas/unix_quotas.sh
|
|
if ! IS_PACKAGE_CHECK; then
|
|
(
|
|
source "$install_dir/unix_quotas/unix_quotas.sh"
|
|
|
|
quotas_find_mount_point "$user_dir"
|
|
quotas_clean_fstab "$quotas_mount_point"
|
|
|
|
# Deactivate quotas
|
|
quotas_deactivate "$quotas_mount_point"
|
|
)
|
|
fi
|
|
|
|
#=================================================
|
|
# REMOVE THE USER WITH CHROOT_MANAGER
|
|
#=================================================
|
|
ynh_script_progression --message="Remove the user with Chroot_manager" --weight=3
|
|
|
|
if ! IS_PACKAGE_CHECK; then
|
|
"$install_dir/chroot_manager.sh" deluser --name "$ssh_user"
|
|
fi
|
|
|
|
#=================================================
|
|
# GENERIC FINALIZATION
|
|
#=================================================
|
|
# DISCLAIMER
|
|
#=================================================
|
|
|
|
ynh_print_info --message="The directory $data_dir hasn't been removed."
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|