Commit 1b459bbb authored by Carlos Remuzzi's avatar Carlos Remuzzi
Browse files

instalando version sin nmcli

parent b6db3e61
# script basado en https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh # script basado en https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh
WIFI_INTERFACE=$(cat /proc/net/wireless | perl -ne '/(\w+):/ && print $1')
AP_PSK=libreCast
USER_NAME=$(whoami)
configurar_ap(){
if nmcli con show $1 > /dev/null 2>&1 ;then
echo "la conexión $1 está ya instalada"
else
echo "creando nueva conneccion $1"
nmcli con add con-name $1 ifname $WIFI_INTERFACE type wifi ssid $1 ip4 192.168.12.2/24 gw4 192.168.12.1
nmcli con modify $1 ipv4.dns "192.168.26.20"
nmcli con modify $1 connection.autoconnect no
nmcli con modify $1 wifi-sec.key-mgmt wpa-psk wifi-sec.psk $2
nmcli con modify $1 wifi-sec.psk libreCast
fi
}
main() { main() {
# colores # colores
if which tput >/dev/null 2>&1; then if which tput >/dev/null 2>&1; then
...@@ -41,7 +58,7 @@ main() { ...@@ -41,7 +58,7 @@ main() {
printf "${BLUE}Clonando libreCast...${NORMAL}\n" printf "${BLUE}Clonando libreCast...${NORMAL}\n"
hash git >/dev/null 2>&1 || { hash git >/dev/null 2>&1 || {
echo "Error: git no esta instalado" echo "Error: git no está instalado"
sudo apt install git sudo apt install git
} }
...@@ -51,12 +68,12 @@ main() { ...@@ -51,12 +68,12 @@ main() {
} }
hash gst-launch-1.0 >/dev/null 2>&1 || { hash gst-launch-1.0 >/dev/null 2>&1 || {
echo "Error: gstreamer no esta instalado" echo "Error: gstreamer no está instalado"
sudo apt install gstreamer1.0-tools sudo apt install gstreamer1.0-tools
} }
hash pacmd >/dev/null 2>&1 || { hash pacmd >/dev/null 2>&1 || {
echo "Error: pulseaudio no esta instalado" echo "Error: pulseaudio no está instalado"
sudo apt install pulseaudio-utils sudo apt install pulseaudio-utils
} }
...@@ -65,35 +82,30 @@ main() { ...@@ -65,35 +82,30 @@ main() {
sudo apt install curl sudo apt install curl
} }
hash nmcli >/dev/null 2>&1 || {
echo "Error: nmcli no esta instalado"
exit 1
}
# esto tiene que adaptarse a diferentes distros # esto tiene que adaptarse a diferentes distros
WIFI_INTERFACE=$(cat /proc/net/wireless | perl -ne '/(\w+):/ && print $1')
AP_NAME=libreCast-s1
AP_PSK=libreCast
USER_NAME=$(whoami)
if [ -d "$HOME/.local/share/applications/" ];then if [ -d "$HOME/.local/share/applications/" ];then
cp $HOME/librecast/libreCast.desktop $HOME/.local/share/applications/ cp $HOME/librecast/libreCast.desktop $HOME/.local/share/applications/
sed -i -e "s/USER/$USER_NAME/g" $HOME/.local/share/applications/libreCast.desktop sed -i -e "s/USER/$USER_NAME/g" $HOME/.local/share/applications/libreCast.desktop
fi fi
if nmcli con show $AP_NAME > /dev/null 2>&1 ;then
echo "la conneccion $AP_NAME esta ya instalada" if which nmcli >/dev/null 2>&1; then
# esto tiene que cambiar
# y jalar un archivo .yaml
# de configuracion
configurar_ap libreCast-s0 $AP_PSK
configurar_ap libreCast-s1 $AP_PSK
configurar_ap libreCast-s2 $AP_PSK
configurar_ap libreCast-s3 $AP_PSK
else else
echo "creando nueva conneccion $AP_NAME" echo "Advertencia: nmcli no está instalado"
nmcli con add con-name $AP_NAME ifname $WIFI_INTERFACE type wifi ssid $AP_NAME ip4 192.168.12.2/24 gw4 192.168.12.1 echo "Será necesario configurar la conexión wifi manualmente"
nmcli con modify $AP_NAME ipv4.dns "192.168.26.20" echo "Consultar la guía de instalación para mayores info"
nmcli con modify $AP_NAME connection.autoconnect no echo "https://gitlab.geo.gob.bo/agetic/librecast/blob/master/INSTALL.md"
nmcli con modify $AP_NAME wifi-sec.key-mgmt wpa-psk wifi-sec.psk $AP_PSK
nmcli con modify $AP_NAME wifi-sec.psk libreCast
fi fi
# configuracion de la resolucion de pantalla # configuración de la resolucion de pantalla
# xdpyinfo | awk '/dimensions/{print $2}' # xdpyinfo | awk '/dimensions/{print $2}'
printf "${GREEN}" printf "${GREEN}"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment