POSIX sh empty value check compatibility - part 1
# Conflicts: # debian/resources/switch/package-all.sh # debian/resources/switch/package-release.sh
This commit is contained in:
parent
fbdca20dee
commit
7cbe496ad9
|
|
@ -6,41 +6,41 @@ cd "$(dirname "$0")"
|
||||||
. ./resources/colors.sh
|
. ./resources/colors.sh
|
||||||
. ./resources/arguments.sh
|
. ./resources/arguments.sh
|
||||||
|
|
||||||
if [ $CPU_CHECK = true ] && [ $USE_SWITCH_SOURCE = false ]; then
|
if [ .$CPU_CHECK = .true ] && [ .$USE_SWITCH_SOURCE = .false ]; then
|
||||||
#check what the CPU and OS are
|
#check what the CPU and OS are
|
||||||
OS_test=$(uname -m)
|
OS_test=$(uname -m)
|
||||||
CPU_arch='unknown'
|
CPU_arch='unknown'
|
||||||
OS_bits='unknown'
|
OS_bits='unknown'
|
||||||
CPU_bits='unknown'
|
CPU_bits='unknown'
|
||||||
if [ $OS_test = 'armv7l' ]; then
|
if [ .$OS_test = .'armv7l' ]; then
|
||||||
OS_bits='32'
|
OS_bits='32'
|
||||||
CPU_bits='32'
|
CPU_bits='32'
|
||||||
# RaspberryPi 3 is actually armv8l but current Raspbian reports the cpu as armv7l and no Raspbian 64Bit has been released at this time
|
# RaspberryPi 3 is actually armv8l but current Raspbian reports the cpu as armv7l and no Raspbian 64Bit has been released at this time
|
||||||
CPU_arch='arm'
|
CPU_arch='arm'
|
||||||
elif [ $OS_test = 'armv8l' ]; then
|
elif [ .$OS_test = .'armv8l' ]; then
|
||||||
# We currently have no test case for armv8l
|
# We currently have no test case for armv8l
|
||||||
OS_bits='unknown'
|
OS_bits='unknown'
|
||||||
CPU_bits='64'
|
CPU_bits='64'
|
||||||
CPU_arch='arm'
|
CPU_arch='arm'
|
||||||
elif [ $OS_test = 'i386' ]; then
|
elif [ .$OS_test = .'i386' ]; then
|
||||||
OS_bits='32'
|
OS_bits='32'
|
||||||
if [ "$(grep -o -w 'lm' /proc/cpuinfo)" = 'lm' ]; then
|
if [ .$(grep -o -w 'lm' /proc/cpuinfo | head -n 1) = .'lm' ]; then
|
||||||
CPU_bits='64'
|
CPU_bits='64'
|
||||||
else
|
else
|
||||||
CPU_bits='32'
|
CPU_bits='32'
|
||||||
fi
|
fi
|
||||||
CPU_arch='x86'
|
CPU_arch='x86'
|
||||||
elif [ $OS_test = 'i686' ]; then
|
elif [ .$OS_test = .'i686' ]; then
|
||||||
OS_bits='32'
|
OS_bits='32'
|
||||||
if [ $(grep -o -w 'lm' /proc/cpuinfo) = 'lm' ]; then
|
if [ .$(grep -o -w 'lm' /proc/cpuinfo | head -n 1) = .'lm' ]; then
|
||||||
CPU_bits='64'
|
CPU_bits='64'
|
||||||
else
|
else
|
||||||
CPU_bits='32'
|
CPU_bits='32'
|
||||||
fi
|
fi
|
||||||
CPU_arch='x86'
|
CPU_arch='x86'
|
||||||
elif [ $OS_test = 'x86_64' ]; then
|
elif [ .$OS_test = .'x86_64' ]; then
|
||||||
OS_bits='64'
|
OS_bits='64'
|
||||||
if [ $(grep -o -w 'lm' /proc/cpuinfo) = 'lm' ]; then
|
if [ .$(grep -o -w 'lm' /proc/cpuinfo | head -n 1) = .'lm' ]; then
|
||||||
CPU_bits='64'
|
CPU_bits='64'
|
||||||
else
|
else
|
||||||
CPU_bits='32'
|
CPU_bits='32'
|
||||||
|
|
@ -48,11 +48,11 @@ if [ $CPU_CHECK = true ] && [ $USE_SWITCH_SOURCE = false ]; then
|
||||||
CPU_arch='x86'
|
CPU_arch='x86'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $CPU_arch = 'arm' ]; then
|
if [ .$CPU_arch = .'arm' ]; then
|
||||||
if [ $OS_bits = '32' ]; then
|
if [ .$OS_bits = .'32' ]; then
|
||||||
export USE_SWITCH_PACKAGE_UNOFFICIAL_ARM=true
|
export USE_SWITCH_PACKAGE_UNOFFICIAL_ARM=true
|
||||||
verbose "Correct CPU/OS detected, using unofficial arm repo"
|
verbose "Correct CPU/OS detected, using unofficial arm repo"
|
||||||
elif [ $OS_bits = '64' ]; then
|
elif [ .$OS_bits = .'64' ]; then
|
||||||
error "You are using a 64bit arm OS this is unsupported"
|
error "You are using a 64bit arm OS this is unsupported"
|
||||||
warning " please rerun with --use-switch-source"
|
warning " please rerun with --use-switch-source"
|
||||||
exit 3
|
exit 3
|
||||||
|
|
@ -61,15 +61,15 @@ if [ $CPU_CHECK = true ] && [ $USE_SWITCH_SOURCE = false ]; then
|
||||||
warning " please rerun with --use-switch-source"
|
warning " please rerun with --use-switch-source"
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
elif [ $CPU_arch = 'x86' ]; then
|
elif [ .$CPU_arch = .'x86' ]; then
|
||||||
if [ $OS_bits = '32' ]; then
|
if [ .$OS_bits = .'32' ]; then
|
||||||
error "You are using a 32bit OS this is unsupported"
|
error "You are using a 32bit OS this is unsupported"
|
||||||
if [ $CPU_bits = '64' ]; then
|
if [ .$CPU_bits = .'64' ]; then
|
||||||
warning " Your CPU is 64bit you should consider reinstalling with a 64bit OS"
|
warning " Your CPU is 64bit you should consider reinstalling with a 64bit OS"
|
||||||
fi
|
fi
|
||||||
warning " please rerun with --use-switch-source"
|
warning " please rerun with --use-switch-source"
|
||||||
exit 3
|
exit 3
|
||||||
elif [ $OS_bits = '64' ]; then
|
elif [ .$OS_bits = .'64' ]; then
|
||||||
verbose "Correct CPU/OS detected"
|
verbose "Correct CPU/OS detected"
|
||||||
else
|
else
|
||||||
error "Unknown OS_bits $OS_bits this is unsupported"
|
error "Unknown OS_bits $OS_bits this is unsupported"
|
||||||
|
|
@ -104,8 +104,8 @@ resources/php.sh
|
||||||
resources/fail2ban.sh
|
resources/fail2ban.sh
|
||||||
|
|
||||||
#FreeSWITCH
|
#FreeSWITCH
|
||||||
if [ $USE_SWITCH_SOURCE = true ]; then
|
if [ .$USE_SWITCH_SOURCE = .true ]; then
|
||||||
if [ $USE_SWITCH_MASTER = true ]; then
|
if [ .$USE_SWITCH_MASTER = .true ]; then
|
||||||
resources/switch/source-master.sh
|
resources/switch/source-master.sh
|
||||||
else
|
else
|
||||||
resources/switch/source-release.sh
|
resources/switch/source-release.sh
|
||||||
|
|
@ -121,14 +121,14 @@ if [ $USE_SWITCH_SOURCE = true ]; then
|
||||||
resources/switch/source-systemd.sh
|
resources/switch/source-systemd.sh
|
||||||
|
|
||||||
else
|
else
|
||||||
if [ $USE_SWITCH_MASTER = true ]; then
|
if [ .$USE_SWITCH_MASTER = .true ]; then
|
||||||
if [ $USE_SWITCH_PACKAGE_ALL = true ]; then
|
if [ .$USE_SWITCH_PACKAGE_ALL = .true ]; then
|
||||||
resources/switch/package-master-all.sh
|
resources/switch/package-master-all.sh
|
||||||
else
|
else
|
||||||
resources/switch/package-master.sh
|
resources/switch/package-master.sh
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ $USE_SWITCH_PACKAGE_ALL = true ]; then
|
if [ .$USE_SWITCH_PACKAGE_ALL = .true ]; then
|
||||||
resources/switch/package-all.sh
|
resources/switch/package-all.sh
|
||||||
else
|
else
|
||||||
resources/switch/package-release.sh
|
resources/switch/package-release.sh
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ if [ -z "$CPU_CHECK" ]; then
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ $HELP = true ]; then
|
if [ .$HELP = .true ]; then
|
||||||
warning "Debian installer script"
|
warning "Debian installer script"
|
||||||
warning " --use-switch-source will use freeswitch from source rather than ${green}(default:packages)"
|
warning " --use-switch-source will use freeswitch from source rather than ${green}(default:packages)"
|
||||||
warning " --use-switch-package-all if using packages use the meta-all package"
|
warning " --use-switch-package-all if using packages use the meta-all package"
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ cp fail2ban/nginx-dos.conf /etc/fail2ban/filter.d/nginx-dos.conf
|
||||||
cp fail2ban/jail.local /etc/fail2ban/jail.local
|
cp fail2ban/jail.local /etc/fail2ban/jail.local
|
||||||
|
|
||||||
#update config if source is being used
|
#update config if source is being used
|
||||||
if [ $USE_FREESWITCH_SOURCE = true ]; then
|
if [ .$USE_FREESWITCH_SOURCE = .true ]; then
|
||||||
sed 's#var/log/freeswitch#usr/local/freeswitch/log#g' -i /etc/fail2ban/jail.local
|
sed 's#var/log/freeswitch#usr/local/freeswitch/log#g' -i /etc/fail2ban/jail.local
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ verbose "Installing FusionPBX"
|
||||||
apt-get install -y --force-yes vim git dbus haveged ssl-cert
|
apt-get install -y --force-yes vim git dbus haveged ssl-cert
|
||||||
apt-get install -y --force-yes ghostscript libtiff5-dev libtiff-tools
|
apt-get install -y --force-yes ghostscript libtiff5-dev libtiff-tools
|
||||||
|
|
||||||
if [ $USE_SYSTEM_MASTER = true ]; then
|
if [ .$USE_SYSTEM_MASTER = .true ]; then
|
||||||
verbose "Using master"
|
verbose "Using master"
|
||||||
BRANCH=""
|
BRANCH=""
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ INPUT=$FILE
|
||||||
#Loop through the registrations and reboot
|
#Loop through the registrations and reboot
|
||||||
[ ! -f $INPUT ] &while read reg_user realm extra
|
[ ! -f $INPUT ] &while read reg_user realm extra
|
||||||
do
|
do
|
||||||
if [ "$realm" = "$domain" ]; then
|
if [ ."$realm" = ."$domain" ]; then
|
||||||
eval 'fs_cli -x "luarun app.lua event_notify internal reboot $reg_user@$realm $vendor"'
|
eval 'fs_cli -x "luarun app.lua event_notify internal reboot $reg_user@$realm $vendor"'
|
||||||
if [ "$pausetime" > 0 ]; then
|
if [ "$pausetime" > 0 ]; then
|
||||||
sleep $pausetime
|
sleep $pausetime
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue