Commit 838e0347 authored by Ignacio Sancho's avatar Ignacio Sancho
Browse files

shellcheck

No related merge requests found
Pipeline #69 passed with stages
in 1 minute and 20 seconds
Showing with 3 additions and 3 deletions
+3 -3
#!/bin/bash
USER=$(whoami)
if [ -f /etc/default/epoptes-client ] && [ $USER = "root" ] ; then
if [ -f /etc/default/epoptes-client ] && [ "$USER" = "root" ] ; then
OLD_NAME_SERVER=$( awk -F "=" '$1~/^SERVER/ { print $2 }' /etc/default/epoptes-client | awk -F ".local" '{ print $1 }') ## Nombre del actual Controlador
if yad --title "CLIENTE EPOPTES" --question --text "¿Quiere cambiar el controlador de éste equipo? Actualmente está configurado: <b>$OLD_NAME_SERVER?</b>" \
--window-icon vitalinux \
......@@ -10,9 +10,9 @@ if [ -f /etc/default/epoptes-client ] && [ $USER = "root" ] ; then
--window-icon vitalinux \
--width="550" --height="200" --center --justify="center" --text-align="center" --button=Hecho:0)
[ "$?" != "0" ] && exit 1
[ $NEW_NAME_SERVER = "" ] && exit 0
[ "$NEW_NAME_SERVER" = "" ] && exit 0
## Cambia el nombre del equipo de ambos ficheros de configuración
if sipcalc $NEW_NAME_SERVER | grep "ERR" > /dev/null 2>&1; then
if sipcalc "$NEW_NAME_SERVER" | grep "ERR" > /dev/null 2>&1; then
sed --follow-symlinks -i "s/.*SERVER=.*/SERVER=${NEW_NAME_SERVER}\.local/g" /etc/default/epoptes-client
else
# Nos proporcinona IP No indicamos red avahi locaol
......
Markdown is supported
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