IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Linux Discussion :

Probléme avec mon script


Sujet :

Linux

  1. #1
    Membre à l'essai
    Profil pro
    Inscrit en
    Février 2007
    Messages
    28
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 28
    Points : 21
    Points
    21
    Par défaut Probléme avec mon script
    Bonjour

    Voici mon 1 er bash
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    #!/bin/bash
     
    # On crée les Group pour le Serveur FTP
     
     groupadd proftpd &&
    useradd -d /srv/ftp -g proftpd -s /usr/bin/proftpdshell proftpd &&
    install -v -d -m775 -o proftpd -g proftpd /srv/ftp &&
    ln -v -s /bin/false /usr/bin/proftpdshell &&
    echo /usr/bin/proftpdshell >> /etc/shells
     
     
    # On télécharge le programme Proftp
     
    cd /usr/src &&
    wget ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.2.tar.bz2 &&
    tar xjf proftpd-1.3.2.tar.bz2 &&
    rm -f proftpd-1.3.2.tar.bz2&&
     
    #On Compil 
     
     cd /usr/src/proftpd-1.3.1 &&
    ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/run &&
    make
     
    #On install ProDFTPD
     
     make install&&
     
     
     cd /usr/src &&
    rm -Rf proftpd-1.3.2&&
     
    #On redemmmare le Serveur FTP
     
     proftpd&&
     
    # 
     
     echo proftpd >> /etc/rc.d/rc.local&&
     
     
    cd /home/ && mkdir gamefiles &&
     
    cd /home/gamefiles && mkdir cs && cd cs&&
    cd /home/gamefiles && mkdir czero && cd czero&&
    cd /home/gamefiles && mkdir css && cd css&&
    cd /home/gamefiles && mkdir dod && cd dod&&
    cd /home/gamefiles && mkdir dods && cd dods&&
    cd /home/gamefiles && mkdir hltv && cd hltv&&
    cd /home/gamefiles && mkdir tf2 && cd tf2&&
     
     
    cd /home/gamefiles/cs &&
    wget http://www.monsite.com/resources/steam.tar.gz &&
    tar zxvf steam.tar.gz &&
    rm -f steam.tar.gz &&
    chmod +x steam&&
     
     
     
    cd /home/gamefiles/czero &&
    wget http://www.monsite.com/resources/steam.tar.gz &&
    tar zxvf steam.tar.gz &&
    rm -f steam.tar.gz &&
    chmod +x steam&&
     
     
     
    cd /home/gamefiles/css &&
    wget http://www.monsite.com/resources/steam.tar.gz &&
    tar zxvf steam.tar.gz &&
    rm -f steam.tar.gz &&
    chmod +x steam&&
     
     
     
    cd /home/gamefiles/dod &&
    wget http://www.monsite.com/resources/steam.tar.gz &&
    tar zxvf steam.tar.gz &&
    rm -f steam.tar.gz &&
    chmod +x steam&&
     
     
     
     
     
     
    cd /home/gamefiles/dods &&
    wget http://www.monsite.com/resources/steam.tar.gz &&
    tar zxvf steam.tar.gz &&
    rm -f steam.tar.gz &&
    chmod +x steam&&
     
     
     
     
     
    cd /home/gamefiles/hltv &&
    wget http://www.monsite.com/resources/steam.tar.gz &&
    tar zxvf steam.tar.gz &&
    rm -f steam.tar.gz &&
    chmod +x steam&&
     
     
     
    cd /home/gamefiles/tf2 &&
    wget http://www.monsite.com/resources/steam.tar.gz &&
    tar zxvf steam.tar.gz &&
    rm -f steam.tar.gz &&
    chmod +x steam&&
     
    cd /home/
     
     
    cd /home/gamefiles/cs &&
    ./steam -command update -game cstrike -dir . -verify_all&&
     
     
    cd /home/gamefiles/czero &&
    ./steam -command update -game czero -dir . -verify_all&&
     
     
    cd /home/gamefiles/css &&
    ./steam -command update -game "counter-strike source" -dir . -verify_all&&
     
     
    cd /home/gamefiles/dod &&
    ./steam -command update -game dod -dir . -verify_all&&
     
     
    cd /home/gamefiles/dods &&
    ./steam -command update -game dods -dir . -verify_all&&
     
    cd /home/gamefiles/hltv &&
    ./steam -command update -game valve -dir . -verify_all&&
     
    cd /home/gamefiles/tf2 &&
    ./steam -command update -game tf -dir . -verify_all&&
    je suis sous Centos , et je trouve que par moment il bug plein bu .

    Il me dit -bash: ./install.sh: /bin/bash^M: bad interpréter: Aucun fichier ou répertoire de ce type.

    De plus comme certaines commande sont assez longue sous Putty , j'aimerais fermée Putty pour qu'il s'execute hors putty , on ma parler de la commande screen . car certaines sont assez longue .

    Voila Donc si quelque personne peuvent me les défaut à peaufiner , sa serait sympa

  2. #2
    Rédacteur
    Avatar de lavazavio
    Homme Profil pro
    Inscrit en
    Décembre 2004
    Messages
    1 673
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : France, Rhône (Rhône Alpes)

    Informations forums :
    Inscription : Décembre 2004
    Messages : 1 673
    Points : 2 412
    Points
    2 412
    Par défaut
    Bonjour,

    Tu n'aurais pas écrit ton script sous Windows par hasard ?
    Sous Windows, les fins de lignes de fichier texte se terminent par "\r\n" alors que sous Linux, c'est un simple "\n". Cette différence se caractérise par l'ajout d'un "^M" à la fin de chaque ligne quand tu passes de Windows à Linux.
    Pour les supprimer, plusieurs solutions :

    ou
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    perl -pi -e 's/\r\n/\n/' install.sh

  3. #3
    Membre à l'essai
    Profil pro
    Inscrit en
    Février 2007
    Messages
    28
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 28
    Points : 21
    Points
    21
    Par défaut
    Super merci ;p c'était bien sa .

    Cependant j'en profite pour te demander , comment faire avec la commande screen pour lancer se script :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    ./steam -command update -game "counter-strike source" -dir . -verify_all&&


    Car si je ferme putty ben sa ne l'installe pas ...

    Une petite solution ?

  4. #4
    Membre habitué
    Profil pro
    Inscrit en
    Avril 2009
    Messages
    126
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2009
    Messages : 126
    Points : 142
    Points
    142
    Par défaut
    Une fois que tu as lancé la commande, tu as essayé de détaché le screen de putty avant de le fermer ?

    Ceci se fait avec la commande "Ctrl+A" puis "D".

  5. #5
    Invité
    Invité(e)
    Par défaut
    Citation Envoyé par snooppy Voir le message
    Super merci ;p c'était bien sa .

    Cependant j'en profite pour te demander , comment faire avec la commande screen pour lancer se script :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    ./steam -command update -game "counter-strike source" -dir . -verify_all&&


    Car si je ferme putty ben sa ne l'installe pas ...

    Une petite solution ?
    Salut,

    tu as la commande nohup qui te permet de lancer un process sans qu'il ne soit lié a un terminal.

    Ton installeur devrait donc continuer à tourner même si tu te déconnectes de putty.

    Tu auras également l'ouptut dans le fichier nohup.out qui sera généré à l'endroit où tu auras lancer la commande.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    nohup ./steam -command update -game "counter-strike source" -dir . -verify_all &

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [PHP-JS] problème avec mon script de connexion
    Par agencep dans le forum Langage
    Réponses: 5
    Dernier message: 31/01/2008, 17h08
  2. [MySQL] Divers petits problèmes avec mon script
    Par fourniey dans le forum PHP & Base de données
    Réponses: 8
    Dernier message: 26/12/2007, 16h20
  3. Problème avec mon script shell case in esac
    Par Olivier Regnier dans le forum Shell et commandes GNU
    Réponses: 2
    Dernier message: 28/06/2007, 22h54
  4. Problème avec mon script
    Par Toinou0123 dans le forum PHP & Base de données
    Réponses: 10
    Dernier message: 30/09/2006, 18h37
  5. [Mail] Problème avec mon script d'envoi de mail
    Par leroivert dans le forum Langage
    Réponses: 18
    Dernier message: 02/12/2005, 00h26

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo