lehrkraefte:snr:informatik:glf22:python-schullaptops

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
lehrkraefte:snr:informatik:glf22:python-schullaptops [2023/06/09 18:50]
Karlheinz Schubert
lehrkraefte:snr:informatik:glf22:python-schullaptops [2023/06/09 19:08] (current)
Karlheinz Schubert
Line 21: Line 21:
  
 <code lang=bash> <code lang=bash>
-#!/bin/bash 
- 
 #!/bin/bash #!/bin/bash
 read -p "Do you wish to remove all files from '/home/tech-lab'?" yn read -p "Do you wish to remove all files from '/home/tech-lab'?" yn
Line 28: Line 26:
     [Yy]* )      [Yy]* ) 
         echo "Refresh user profile tech-lab"         echo "Refresh user profile tech-lab"
-        cd /etc/skel+        cd /home/tech-lab; 
-        if [[ $PWD/ != /home/tech-lab ]]; then  +        if [[ $PWD/ != /home/tech-lab]]; then  
-            echo "$PWD not /home/tech-lab !" +            echo "$PWD not /home/tech-lab !"; 
-            exit;;+            exit;
         fi         fi
-        rm -rdf * +        rm -rdf *; 
-        rm -rdf .* +        rm -rdf .*; 
-        cd /etc/skel/ +        cd /etc/skel/; 
-        cp -r . /home/tech-lab +        cp -r . /home/tech-lab; 
-        cd /home/tech-lab +        cd /home/tech-lab; 
-        sudo chown tech-lab .* +        sudo chown tech-lab .*; 
-        sudo chgrp tech-lab .* +        sudo chgrp tech-lab .*;
-        break;+
-    [Nn]* )  +
-        echo "Nothing done"+
         exit;;         exit;;
 +
 +    [Nn]* )
 +        echo "Nothing done";
 +        exit;;
 +
     * )     * )
-        echo "Input not recognized"+        echo "Input not recognized":
         exit;;         exit;;
 esac esac
- +echo "finished."
- +
  
 </code> </code>
  
  
  • lehrkraefte/snr/informatik/glf22/python-schullaptops.1686329453.txt.gz
  • Last modified: 2023/06/09 18:50
  • by Karlheinz Schubert