Skip to content
This repository has been archived by the owner on May 24, 2020. It is now read-only.

Commit

Permalink
Execute custom script (#66)
Browse files Browse the repository at this point in the history
Allow execution of a custom script at the end of the installation.
  • Loading branch information
SohKa authored and pitchum committed Nov 18, 2019
1 parent cb1f9ed commit b755e06
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions script/hypercube/hypercube.sh
Expand Up @@ -457,6 +457,12 @@ function configure_vpnclient() {
ynh-vpnclient-loadcubefile.sh -u "${settings[yunohost,user]}" -p "${settings[yunohost,user_password]}" -c "${tmp_dir}/config.cube" &>> $log_file || true
}

function execute_customscript() {
logfile ${FUNCNAME[0]}

bash "$custom_script" &>> $log_file
}

function monitoring_ip() {
logfile ${FUNCNAME[0]}
set +E
Expand Down Expand Up @@ -623,6 +629,7 @@ function end_installation() {
declare -A settings
tmp_dir=$(mktemp -dp /tmp/ labriqueinternet-installhypercube-XXXXX)
hypercube_file="${tmp_dir}/install.hypercube"
custom_script="/usr/local/bin/hypercube_custom.sh"
exit_status=0
webserver_pid=
is_dyndns_useful=false
Expand Down Expand Up @@ -764,6 +771,11 @@ else
info "Configuring Wifi Hotspot..."
configure_hotspot

if [ -f "$custom_script" ]; then
info "Execute custom script..."
execute_customscript
fi

info "Rebooting..."

if [ -f /etc/crypttab ]; then
Expand Down

0 comments on commit b755e06

Please sign in to comment.