1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gogs_ynh.git synced 2024-09-03 20:36:23 +02:00

Fix linter warnings

This commit is contained in:
ericgaspar 2020-11-20 08:45:49 +01:00
parent f3827df369
commit 3a2be9d683
No known key found for this signature in database
GPG key ID: 574F281483054D44
8 changed files with 3 additions and 77 deletions

View file

@ -21,17 +21,7 @@
port_already_use=1 (6000) port_already_use=1 (6000)
change_url=1 change_url=1
;;; Levels ;;; Levels
Level 1=auto
Level 2=auto
Level 3=auto
# https://github.com/YunoHost-Apps/gogs_ynh/blob/master/conf/login_source.sql
Level 4=1
Level 5=auto Level 5=auto
Level 6=auto
Level 7=auto
Level 8=0
Level 9=0
Level 10=0
;;; Upgrade options ;;; Upgrade options
; commit=aa075b2051ffad7b0b6fef3a9c767376d5bdbfab ; commit=aa075b2051ffad7b0b6fef3a9c767376d5bdbfab
name=Before multi_instance and refactoring name=Before multi_instance and refactoring

View file

@ -11,7 +11,7 @@ source /usr/share/yunohost/helpers
ynh_abort_if_errors ynh_abort_if_errors
# Load common variables and helpers # Load common variables and helpers
source ../settings/scripts/experimental_helper.sh
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
# Retrieve app settings # Retrieve app settings

View file

@ -11,7 +11,7 @@ source /usr/share/yunohost/helpers
ynh_abort_if_errors ynh_abort_if_errors
# Import common cmd # Import common cmd
source ./experimental_helper.sh
source ./_common.sh source ./_common.sh
# RETRIEVE ARGUMENTS # RETRIEVE ARGUMENTS

View file

@ -1,61 +0,0 @@
# Delete a file checksum from the app settings
#
# $app should be defined when calling this helper
#
# usage: ynh_remove_file_checksum file
# | arg: file - The file for which the checksum will be deleted
ynh_delete_file_checksum () {
local checksum_setting_name=checksum_${1//[\/ ]/_} # Replace all '/' and ' ' by '_'
ynh_app_setting_delete $app $checksum_setting_name
}
# Start or restart a service and follow its booting
#
# usage: ynh_check_starting "Line to match" [Log file] [Timeout] [Service name]
#
# | arg: Line to match - The line to find in the log to attest the service have finished to boot.
# | arg: Log file - The log file to watch
# | arg: Service name
# /var/log/$app/$app.log will be used if no other log is defined.
# | arg: Timeout - The maximum time to wait before ending the watching. Defaut 300 seconds.
ynh_check_starting () {
local line_to_match="$1"
local service_name="${4:-$app}"
local app_log="${2:-/var/log/$service_name/$service_name.log}"
local timeout=${3:-300}
ynh_clean_check_starting () {
# Stop the execution of tail.
kill -s 15 $pid_tail 2>&1
ynh_secure_remove "$templog" 2>&1
}
echo "Starting of $service_name" >&2
systemctl stop $service_name
local templog="$(mktemp)"
# Following the starting of the app in its log
tail -F -n0 "$app_log" > "$templog" &
# Get the PID of the tail command
local pid_tail=$!
systemctl start $service_name
local i=0
for i in `seq 1 $timeout`
do
# Read the log until the sentence is found, that means the app finished to start. Or run until the timeout
if grep --quiet "$line_to_match" "$templog"
then
echo "The service $service_name has correctly started." >&2
break
fi
echo -n "." >&2
sleep 1
done
if [ $i -eq $timeout ]
then
echo "The service $service_name didn't fully started before the timeout." >&2
fi
echo ""
ynh_clean_check_starting
}

View file

@ -11,7 +11,7 @@ source /usr/share/yunohost/helpers
ynh_abort_if_errors ynh_abort_if_errors
# Load common variables and helpers # Load common variables and helpers
source ./experimental_helper.sh
source ./_common.sh source ./_common.sh
# Retrieve arguments # Retrieve arguments

View file

@ -8,7 +8,6 @@
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
# Load common variables and helpers # Load common variables and helpers
source ./experimental_helper.sh
source ./_common.sh source ./_common.sh
#================================================= #=================================================

View file

@ -11,7 +11,6 @@ source /usr/share/yunohost/helpers
ynh_abort_if_errors ynh_abort_if_errors
# Load common variables and helpers # Load common variables and helpers
source ../settings/scripts/experimental_helper.sh
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
# Retrieve old app settings # Retrieve old app settings

View file

@ -11,7 +11,6 @@ source /usr/share/yunohost/helpers
ynh_abort_if_errors ynh_abort_if_errors
# Load common variables and helpers # Load common variables and helpers
source ./experimental_helper.sh
source ./_common.sh source ./_common.sh
# Retrieve app settings # Retrieve app settings