shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Erro no script do apollon [longo]


From: Marcos
Subject: Erro no script do apollon [longo]
Date: Sun, 18 Jul 2004 15:38:16 +0000

Pessoal olha o erro deste script:

zeus:/home/servidor/upload# dpkg -i lhp2p_1.0_i386.deb
(Lendo banco de dados ... 104316 arquivos e diretórios atualmente
instalados.)
Preparando para substituir lhp2p 1.0 (usando lhp2p_1.0_i386.deb) ...
Descompactando substituto lhp2p ...
Instalando lhp2p (1.0) ...
Instalando o ~/.giFT:
/var/lib/dpkg/info/lhp2p.postinst: eval: line 1: syntax error near
unexpected token `('

Alguém pode dar um help???

#!/bin/sh
#
# For a selected list of users, copy $SRC to user's home dir
#
# Author: Mateus Caruccio <mateus.caruccio at gmail.com>
#

set -e
# Automatically added by dh_installmenu
if [ "$1" = "configure" ] && [ -x /usr/bin/update-menus ]; then
update-menus ; fi
# End automatically added section

SRC="/etc/skel/.giFT"

# ensure dir sanity
if [ ! -d "$SRC" ]; then
       echo "$SRC não existe"
       exit 1
fi

# fetch user list from /etc/passwd
userlist=
for user in $(cut -f1 -d: /etc/passwd); do
       userlist=" $userlist $user ? off"
done

# ask user for user to install ~/.giFT
sel_users=
if [ ! -z "$userlist" ]; then
       sel_users=$(dialog --checklist "Selecione os usuários para
instalar a configuração" 0 0 0  $userlist 2>&1)
else
       exit 0
fi

echo 'Instalando o ~/.giFT: '

# for each user...
for u in $(eval echo $sel_users); do

       h=$(eval echo ~$u)  # find it's ~

       if [ -d "$h" ]; then
               g=$(\ls -ld $h | awk '{print $4}') # find it's ~ group
               echo -n "$u ($g) ... "
               cp -a "$SRC" "$h" --reply=no # --reply=no will don't
overwirte existing files
               chown -R $u.$g $h/.giFT # Muda permissao do grupo e user
               echo done
       else
               echo "$u (?) ... skip (no home dir)"
       fi
done

echo

-- 
___________________________
Marcos José Setim
marcos.ops at gmail.com
marcos_ops at gmx.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]