• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    langage de programmation

    Scheduled Pinned Locked Moved
    General
    3
    51
    9.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • george1421G
      george1421 Moderator @julio
      last edited by

      @julio OK give me 5 minutes and I will give you more hints.

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

      1 Reply Last reply Reply Quote 0
      • george1421G
        george1421 Moderator @julio
        last edited by george1421

        @julio To get into debug mode on the pxe booting computer make sure you enabled debug mode.

        Screenshot from 2021-02-02 17-42-30.png

        See the Schedule as debug task option? When you do this and pxe boot the target computer you will end at the FOS Linux command prompt.

        In your script for debugging purposes you should add

        echo "Some step in the script"
        debugPause;
        

        This way you will know when and where your script is in the program. I add these quite often at specific points in my scripts.

        Also make sure you add your script like fog.custominstall or renamehost.sh to the master script of fog.postdownload or your script will not be called by fog.

        IF you are ready to debug your script AND you are at the FOS Linux command prompt key in fog to start the deployment. The FOG deployment will stop at all of the debugPause commands during deployment. Press enter to go to the next step. When / IF you get to see OK, osid is 50/Linux on the screen and you see a bug you can press CTRL-C to exit the script. The FOG Postinstall scripts are run right after the last partclone copy screen. You can fix what you need then restart the deployment process again by typing fog in again. You can do this testing as many times as you want without needing to reboot the pxe target computer.

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

        J 1 Reply Last reply Reply Quote 0
        • J
          julio @george1421
          last edited by

          @george1421
          j’ai reussi à entrer dans la partition de debogage. j’ai executer la commande lsblk. voici ce que j’obtient.partitionparclone.PNG

          george1421G 1 Reply Last reply Reply Quote 0
          • J
            julio @george1421
            last edited by

            @george1421 salut george. j’ai eu une erreur qui s’affiche on me precise syntax error. donc le script essaye de s’executer mais petite erreur. voici l’image en questionerreur.PNG

            1 Reply Last reply Reply Quote 0
            • J
              julio @Sebastian Roth
              last edited by

              @sebastian-roth oui roth j’ai vu ou il y’a erreur: c’est au niveau de la ligne5 dans mon code: ici

              if [[“$osid”==“50”]]; then ça me dire sysntax error. juste pour vous donner un indice.

              1 Reply Last reply Reply Quote 0
              • george1421G
                george1421 Moderator @julio
                last edited by

                @julio said in langage de programmation:

                ’ai reussi à entrer dans la partition de debogage. j’ai executer la commande lsblk. voici ce que j’obtient

                Ok I see only one partition then /dev/sda1. Now you know what your target partition is.

                donc le script essaye de s’executer mais petite erreur.

                Here is an example of my if/then

                        if [[ -z $hd ]]; then
                            handleError "Could not find hdd to use"
                        fi
                

                When you look at your if / then statement do you see any differences? How about spacing?

                Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                J 1 Reply Last reply Reply Quote 0
                • J
                  julio @george1421
                  last edited by

                  @george1421 voici mon script finalmon scriptfinal.PNG

                  george1421G 2 Replies Last reply Reply Quote 0
                  • george1421G
                    george1421 Moderator @julio
                    last edited by

                    @julio You MUST look at the if statement. It is wrong.

                    if[[ $osid == 50 ]];then
                    

                    Should be rewritten as

                    if [[ $osid == "50" ]]; then
                    

                    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                    1 Reply Last reply Reply Quote 0
                    • george1421G
                      george1421 Moderator @julio
                      last edited by

                      @julio I also see you are missing fi

                      if [[ $osid == "50" ]]; then
                          echo "Hello Mom"
                      fi
                      

                      Is the syntax

                      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                      J 1 Reply Last reply Reply Quote 0
                      • J
                        julio @george1421
                        last edited by

                        @george1421 désolé j’ai toujours la meme erreur. je sais pas si je doit changer totalement la ligne 5.script1.PNG en passant j’ai bien
                        fi à la fin de mon script.

                        george1421G 1 Reply Last reply Reply Quote 0
                        • george1421G
                          george1421 Moderator @julio
                          last edited by george1421

                          @julio Your program is still wrong. I will type short items because I am tired.

                          #!/bin/bash
                          echo "hello"
                          read
                          
                          if [[ $osid == "50" ]]; then
                            echo "ok"
                          
                            mdkir -p /ext
                          
                            mount /dev/sda1 /ext
                          
                            echo $hostname > /ext/etc/hostname
                          
                            unmount /ext
                          fi
                          
                          1. Your if command needs a space after if and the first square bracket
                          2. You need fi at the end to show the closing of the if statement.

                          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                          J 2 Replies Last reply Reply Quote 0
                          • J
                            julio @george1421
                            last edited by

                            @george1421 salut george. vraiment merci beaucoup pour tout ça fonctionne bien maintenant

                            1 Reply Last reply Reply Quote 0
                            • J
                              julio @george1421
                              last edited by

                              @george1421 je tenais à te remercier une fois de plus. thank you again. je te dois une fiere chandel. pour ceux qui en ont besion voici le script final en question.scriptfonctionnel.PNG

                              1 Reply Last reply Reply Quote 1
                              • J
                                julio
                                last edited by

                                bonjour george. j’ai un dernier point sur lequel je sollicite ton aide. je veux faire un script pour joindre un domaine active directory avec des machines linux. à tu une idée de comment je pourrais me prendre avec ça. merci bien

                                george1421G 1 Reply Last reply Reply Quote 0
                                • george1421G
                                  george1421 Moderator @julio
                                  last edited by

                                  @julio Single command realm https://www.redhat.com/sysadmin/linux-active-directory

                                  https://4sysops.com/archives/join-a-debian-linux-server-to-an-active-directory-domain/

                                  once command once the installed packages are available.

                                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                                  J 1 Reply Last reply Reply Quote 0
                                  • J
                                    julio @george1421
                                    last edited by

                                    @george1421 said in langage de programmation:

                                    @julio Single command realm https://www.redhat.com/sysadmin/linux-active-directory

                                    https://4sysops.com/archives/join-a-debian-linux-server-to-an-active-directory-domain/

                                    once command once the installed packages are available.

                                    Bonjour george: désolé d’être absent depuis ces dernières temps. je redigiais mon rapport sur tout ce que j’ai déja fais.

                                    j’ai suivie les tutos que tu m’as envoyé mais je n’arrive pas à joindre le domaine active directory avec la distribution linux ubuntu 18.04 j’ai installer tous les paquets donc j’avais besion mais cela ne fonctionne pas. y’a t 'il un fichier spécifique que je pourrais configurer pour fais fonctionné la jointure au domaine???

                                    1 Reply Last reply Reply Quote 0
                                    • J
                                      julio
                                      last edited by

                                      domaineAD.PNG

                                      bonjour george voici une erreur de ce que j’ai rencontrer comme problème.

                                      george1421G 1 Reply Last reply Reply Quote 0
                                      • george1421G
                                        george1421 Moderator @julio
                                        last edited by

                                        @julio On your target computer where you want to run the realm command. Ping lheh.be does the response come from on of your domain controllers?

                                        Also for your domain you use the Administrator account or should another account be used that has rights to add computers to the domain?

                                        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                                        J 2 Replies Last reply Reply Quote 0
                                        • J
                                          julio @george1421
                                          last edited by

                                          @george1421 bonjour george, mon domaine c’est bien lheh.be et le nom de mon serveur est srvldap.lheh.be je ping bien srvldap.lheh.be et dans mon active directory j’ai créer une OU dans laquelle mes utilisateurs s’y trouve. et comment je pourrais fais en sorte que ma machine rejoint le domaine directement. quelle fichier je pourrais configuré pour cela.

                                          1 Reply Last reply Reply Quote 0
                                          • J
                                            julio @george1421
                                            last edited by

                                            @george1421 Bonjour george, oui mon domaine est bien et belle lheh.be et je ping bien mon domaine lheh.be et le nom de mon serveur windows 2016 est srvldap.lheh.be mais quand j’essaye de joindre le domaine avec la commande realm ça ne fonctionne pas. as tu une idée à me proposé???

                                            george1421G 1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 2 / 3
                                            • First post
                                              Last post

                                            211

                                            Online

                                            12.0k

                                            Users

                                            17.3k

                                            Topics

                                            155.2k

                                            Posts
                                            Copyright © 2012-2024 FOG Project