Fix setup
This commit is contained in:
parent
de3ed9a061
commit
df9a099520
21
setup.sh
21
setup.sh
|
@ -9,25 +9,24 @@ unset ${!setup_@}
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
# Configuration ; folders and files to create/chown/copy...
|
# Configuration ; folders and files to create/chown/copy...
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
# Directories to check ONLY with mkdir -p
|
||||||
|
setup_dir_bin="usr/local/bin"
|
||||||
|
# main app name
|
||||||
|
setup_app_name="upd"
|
||||||
|
# bin uri
|
||||||
|
set_bin_uri="$setup_dir_bin/$setup_app_name"
|
||||||
|
|
||||||
# Directories to CHOWN -R
|
# Directories to CHOWN -R
|
||||||
set_dir_R_CHO=(
|
set_dir_R_CHO=(
|
||||||
var/lib/upd
|
var/lib/upd
|
||||||
etc/upd
|
etc/upd
|
||||||
)
|
)
|
||||||
|
|
||||||
# Directories to check ONLY with mkdir -p
|
|
||||||
setup_dir_bin="usr/local/bin"
|
|
||||||
|
|
||||||
# main app name
|
|
||||||
setup_app_name="upd"
|
|
||||||
# filename application to CHOWN + CHMOD 755
|
# filename application to CHOWN + CHMOD 755
|
||||||
set_files_R_CHO=(
|
set_files_R_CHO=(
|
||||||
upd
|
upd
|
||||||
)
|
)
|
||||||
|
|
||||||
# bin uri
|
|
||||||
set_bin_uri="$setup_dir_bin/$setup_file_bin"
|
|
||||||
|
|
||||||
#======================================================================
|
#======================================================================
|
||||||
|
|
||||||
#----------------------
|
#----------------------
|
||||||
|
@ -133,12 +132,12 @@ printf '\n%b\n%b\n%b\n' \
|
||||||
|
|
||||||
# Updaate && Check Version
|
# Updaate && Check Version
|
||||||
setup_ins_version=`
|
setup_ins_version=`
|
||||||
awk 'NR==2 {print $3}' "/$setup_dir_bin/$setup_file_bin" 2>/dev/null`
|
awk 'NR==2 {print $3}' "/$set_bin_uri" 2>/dev/null`
|
||||||
setup_new_version=`
|
setup_new_version=`
|
||||||
awk 'NR==2 {print $3}' "$setup_dir_bin/$setup_file_bin" 2>/dev/null`
|
awk 'NR==2 {print $3}' "$set_bin_uri" 2>/dev/null`
|
||||||
|
|
||||||
[[ "$setup_ins_version" == "$setup_new_version" ]] \
|
[[ "$setup_ins_version" == "$setup_new_version" ]] \
|
||||||
&& echo "$setup_file_bin is already up to date" \
|
&& echo "$setup_app_name is already up to date" \
|
||||||
&& unset ${!setup_@} \
|
&& unset ${!setup_@} \
|
||||||
&& exit 0
|
&& exit 0
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# version: 0.0.10
|
# version: 0.0.11
|
||||||
# file: upd
|
# file: upd
|
||||||
# Folder: /usr/local/bin
|
# Folder: /usr/local/bin
|
||||||
# By echolib
|
# By echolib
|
||||||
|
|
|
@ -22,7 +22,6 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf -v versions '%s\n%s' "$v_cur" "$v_onl"
|
printf -v versions '%s\n%s' "$v_cur" "$v_onl"
|
||||||
|
|
||||||
[[ `sort -V <<< "$versions" | tail -1` == $v_cur ]] \
|
[[ `sort -V <<< "$versions" | tail -1` == $v_cur ]] \
|
||||||
&& return
|
&& return
|
||||||
|
|
||||||
|
|
|
@ -9,25 +9,24 @@ unset ${!setup_@}
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
# Configuration ; folders and files to create/chown/copy...
|
# Configuration ; folders and files to create/chown/copy...
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
# Directories to check ONLY with mkdir -p
|
||||||
|
setup_dir_bin="usr/local/bin"
|
||||||
|
# main app name
|
||||||
|
setup_app_name="upd"
|
||||||
|
# bin uri
|
||||||
|
set_bin_uri="$setup_dir_bin/$setup_app_name"
|
||||||
|
|
||||||
# Directories to CHOWN -R
|
# Directories to CHOWN -R
|
||||||
set_dir_R_CHO=(
|
set_dir_R_CHO=(
|
||||||
var/lib/upd
|
var/lib/upd
|
||||||
etc/upd
|
etc/upd
|
||||||
)
|
)
|
||||||
|
|
||||||
# Directories to check ONLY with mkdir -p
|
|
||||||
setup_dir_bin="usr/local/bin"
|
|
||||||
|
|
||||||
# main app name
|
|
||||||
setup_app_name="upd"
|
|
||||||
# filename application to CHOWN + CHMOD 755
|
# filename application to CHOWN + CHMOD 755
|
||||||
set_files_R_CHO=(
|
set_files_R_CHO=(
|
||||||
upd
|
upd
|
||||||
)
|
)
|
||||||
|
|
||||||
# bin uri
|
|
||||||
set_bin_uri="$setup_dir_bin/$setup_file_bin"
|
|
||||||
|
|
||||||
#======================================================================
|
#======================================================================
|
||||||
|
|
||||||
#----------------------
|
#----------------------
|
||||||
|
@ -133,12 +132,12 @@ printf '\n%b\n%b\n%b\n' \
|
||||||
|
|
||||||
# Updaate && Check Version
|
# Updaate && Check Version
|
||||||
setup_ins_version=`
|
setup_ins_version=`
|
||||||
awk 'NR==2 {print $3}' "/$setup_dir_bin/$setup_file_bin" 2>/dev/null`
|
awk 'NR==2 {print $3}' "/$set_bin_uri" 2>/dev/null`
|
||||||
setup_new_version=`
|
setup_new_version=`
|
||||||
awk 'NR==2 {print $3}' "$setup_dir_bin/$setup_file_bin" 2>/dev/null`
|
awk 'NR==2 {print $3}' "$set_bin_uri" 2>/dev/null`
|
||||||
|
|
||||||
[[ "$setup_ins_version" == "$setup_new_version" ]] \
|
[[ "$setup_ins_version" == "$setup_new_version" ]] \
|
||||||
&& echo "$setup_file_bin is already up to date" \
|
&& echo "$setup_app_name is already up to date" \
|
||||||
&& unset ${!setup_@} \
|
&& unset ${!setup_@} \
|
||||||
&& exit 0
|
&& exit 0
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue