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

langage de programmation

Scheduled Pinned Locked Moved
General
3
51
9.6k
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.
  • J
    julio @Sebastian Roth
    last edited by Feb 2, 2021, 9:46 PM

    @sebastian-roth salut roth. non je ne vois rien sur la console de mon serveur fog apparement le script ne fonctionne pas. je veux bien savoir.
    comment verifier que le script est bien fonctionnel???
    j’ai bien donner les droits d’execution à savoir chmod +x renamehost.sh

    1 Reply Last reply Reply Quote 0
    • J
      julio @george1421
      last edited by Feb 2, 2021, 10:34 PM

      @george1421 salut george. oui j’ai fais ce que tu m’as démander mais je n’arrive pas sur l’invite de commande de fos linux. y’a t’il pas une autre manière???

      G 2 Replies Last reply Feb 2, 2021, 10:40 PM Reply Quote 0
      • G
        george1421 Moderator @julio
        last edited by Feb 2, 2021, 10:40 PM

        @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
        • G
          george1421 Moderator @julio
          last edited by george1421 Feb 2, 2021, 4:56 PM Feb 2, 2021, 10:52 PM

          @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 Feb 3, 2021, 10:40 AM Reply Quote 0
          • J
            julio @george1421
            last edited by Feb 3, 2021, 9:59 AM

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

            G 1 Reply Last reply Feb 3, 2021, 10:58 AM Reply Quote 0
            • J
              julio @george1421
              last edited by Feb 3, 2021, 10:40 AM

              @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 Feb 3, 2021, 10:57 AM

                @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
                • G
                  george1421 Moderator @julio
                  last edited by Feb 3, 2021, 10:58 AM

                  @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 Feb 3, 2021, 11:15 AM Reply Quote 0
                  • J
                    julio @george1421
                    last edited by Feb 3, 2021, 11:15 AM

                    @george1421 voici mon script finalmon scriptfinal.PNG

                    G 2 Replies Last reply Feb 3, 2021, 11:22 AM Reply Quote 0
                    • G
                      george1421 Moderator @julio
                      last edited by Feb 3, 2021, 11:22 AM

                      @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
                      • G
                        george1421 Moderator @julio
                        last edited by Feb 3, 2021, 11:25 AM

                        @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 Feb 3, 2021, 1:37 PM Reply Quote 0
                        • J
                          julio @george1421
                          last edited by Feb 3, 2021, 1:37 PM

                          @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.

                          G 1 Reply Last reply Feb 3, 2021, 2:10 PM Reply Quote 0
                          • G
                            george1421 Moderator @julio
                            last edited by george1421 Feb 3, 2021, 8:11 AM Feb 3, 2021, 2:10 PM

                            @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 Feb 3, 2021, 4:32 PM Reply Quote 0
                            • J
                              julio @george1421
                              last edited by Feb 3, 2021, 4:32 PM

                              @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 Feb 3, 2021, 5:31 PM

                                @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 Feb 15, 2021, 8:18 AM

                                  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

                                  G 1 Reply Last reply Feb 15, 2021, 11:01 AM Reply Quote 0
                                  • G
                                    george1421 Moderator @julio
                                    last edited by Feb 15, 2021, 11:01 AM

                                    @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 Mar 5, 2021, 10:45 AM Reply Quote 0
                                    • J
                                      julio @george1421
                                      last edited by Mar 5, 2021, 10:45 AM

                                      @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 Mar 5, 2021, 10:48 AM

                                        domaineAD.PNG

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

                                        G 1 Reply Last reply Mar 5, 2021, 12:37 PM Reply Quote 0
                                        • G
                                          george1421 Moderator @julio
                                          last edited by Mar 5, 2021, 12:37 PM

                                          @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 Mar 9, 2021, 12:31 PM Reply Quote 0
                                          • 1
                                          • 2
                                          • 3
                                          • 2 / 3
                                          • First post
                                            Last post

                                          167

                                          Online

                                          12.0k

                                          Users

                                          17.3k

                                          Topics

                                          155.2k

                                          Posts
                                          Copyright © 2012-2024 FOG Project