mirror of
https://github.com/YunoHost/install_script.git
synced 2024-09-03 20:06:25 +02:00
Apply shellcheck advices
This commit is contained in:
parent
0b5ffbc9a7
commit
97234cfced
1 changed files with 9 additions and 9 deletions
|
@ -48,7 +48,7 @@ $1
|
|||
" 1>&2
|
||||
tput sgr 0
|
||||
notify_about_install_logs
|
||||
exit ${2:-1}
|
||||
exit "${2:-1}"
|
||||
}
|
||||
|
||||
this_script_path() {
|
||||
|
@ -60,7 +60,7 @@ this_script_path() {
|
|||
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||
done
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||
echo $DIR
|
||||
echo "$DIR"
|
||||
}
|
||||
|
||||
ensure_root() {
|
||||
|
@ -85,7 +85,7 @@ installscript_dependencies() {
|
|||
-- \
|
||||
apt-get -o Dpkg::Options::="--force-confold" \
|
||||
-y install \
|
||||
$packages \
|
||||
"$packages" \
|
||||
|| return 2
|
||||
|
||||
return 0
|
||||
|
@ -148,7 +148,7 @@ setup_package_source() {
|
|||
echo "deb http://repo.yunohost.org/ megusta main" > $CUSTOMAPT
|
||||
|
||||
# Also add repositories for 'testing' and/or 'unstable' if the script has been called with those arguments
|
||||
if [[ "$#" > "0" ]]; then
|
||||
if [[ "$#" -gt "0" ]]; then
|
||||
if [[ "$1" == "test" ]] || [[ "$1" == "testing" ]] ; then
|
||||
echo "deb http://repo.yunohost.org/ testing main" >> $CUSTOMAPT
|
||||
fi
|
||||
|
@ -172,9 +172,9 @@ apt_update() {
|
|||
register_debconf() {
|
||||
if [[ $(lsb_release -c | awk '{print $2}') == jessie ]];
|
||||
then
|
||||
debconf-set-selections $(this_script_path)/debconfjessie
|
||||
debconf-set-selections "$(this_script_path)/debconfjessie"
|
||||
else
|
||||
debconf-set-selections $(this_script_path)/debconfv2
|
||||
debconf-set-selections "$(this_script_path)/debconfv2"
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -199,10 +199,10 @@ workaround_avahi_installation() {
|
|||
id avahi > /dev/null 2>&1 || return 0
|
||||
|
||||
# Get a random unused uid between 500 and 999 (system-user)
|
||||
local avahi_id=$((500 + $RANDOM % 500))
|
||||
while ! cat /etc/passwd | cut -d ':' -f 3 | grep -q $avahi_id ;
|
||||
local avahi_id=$((500 + RANDOM % 500))
|
||||
while ! cut -d ':' -f 3 /etc/passwd | grep -q $avahi_id ;
|
||||
do
|
||||
avahi_id=$((500 + $RANDOM % 500))
|
||||
avahi_id=$((500 + RANDOM % 500))
|
||||
done
|
||||
|
||||
# Use the same adduser parameter as in the avahi-daemon postinst script
|
||||
|
|
Loading…
Add table
Reference in a new issue