Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo this is done before the reboot
- echo to prepare anything that you want to do
- [ -f /tmp/after-reboot ] && rm -f /tmp/after-reboot
- cat << REBOOT >> /root/completeme.sh
- touch /tmp/after-reboot
- rm -f /etc/profile
- mv /etc/profile.bak /etc/profile
- echo DONE
- REBOOT
- chmod +x /root/completeme.sh
- cp /etc/profile /etc/profile.bak
- echo /root/completeme.sh >> /etc/profile
- [ -f /tmp/after-reboot ] && echo testfile exists && exit 9
- echo we now know that testfile does not exist
- reboot
- #######[student@localhost bash-scripting]$ history
- 1 sudo dnf install -y git vim
- 2 git clone https://github.com/sandervanvugt/ckad
- 3 cd ckad/
- 4 ls
- 5 ./kube-setup.sh
- 6 sudo reboot
- 7 cd bash-scripting/
- 8 ./countdown 3
- 9 tail ckad/kube-setup.sh
- 10 minikube start --memory 4096 --vm-driver=kvm2
- 11 git clone https://github.com/sandervanvugt/bash-scripting
- 12 cd bash
- 13 cd bash-scripting/
- 14 ls
- 15 vim script1
- 16 ls
- 17 echo $?
- 18 ls ioehrgoiheriog
- 19 echo $?
- 20 ls /root/
- 21 echo $?
- 22 script1
- 23 echo $PATH
- 24 pwd
- 25 ./script1
- 26 ls -l
- 27 chmod +x script*
- 28 ./script1
- 29 vim script2
- 30 ./script2
- 31 cat script2
- 32 pwd
- 33 source script2
- 34 cd -
- 35 . script2
- 36 sudo dnf search network-scripts
- 37 sudo dnf install network-scripts
- 38 vim /etc/init.d/network
- 39 vim script2b
- 40 vim colors
- 41 chmod +x script2b
- 42 ./script2b
- 43 vim colors
- 44 ./script2b
- 45 cat script2b
- 46 cat colors
- 47 ls
- 48 vim script3
- 49 ./script3 a b c d e f g h i j k l m n b
- 50 cat script3
- 51 vim script4
- 52 ./script4 a b c d e
- 53 cat script4
- 54 vim script4
- 55 ./script4 a b c d e
- 56 vim script4
- 57 vim script5
- 58 cd /lib/modules
- 59 ls
- 60 uname -r
- 61 cd `uname -r`
- 62 cd -
- 63 cd $(uname -r)
- 64 cd
- 65 cd bash-scripting/
- 66 ls
- 67 vim script6
- 68 cat script6
- 69 ./script6 /usr/bin/blah
- 70 vim script6
- 71 ./script6 /usr/bin/blah
- 72 ./countdown 12
- 73 vim countdown
- 74 ./countdown 0
- 75 vim countdown
- 76 vim script7
- 77 ./script7
- 78 vim script8
- 79 sudo useradd alex
- 80 ./script8 alex
- 81 sudo useradd alexander
- 82 ./script8 alex
- 83 ./script8 lex
- 84 vim script8
- 85 ./script8 lex
- 86 ./script8 alex
- 87 vim script8
- 88 ./script8 alex
- 89 ./script8 lex
- 90 vim script8
- 91 ./script8 lex
- 92 ./script8 alex
- 93 vim script8
- 94 vim script9
- 95 man test
- 96 vim script9
- 97 ./script9
- 98 echo $?
- 99 vim script9
- 100 ./script9
- 101 echo $?
- 102 vim script9b
- 103 chmod +x script9b
- 104 ./script9b
- 105 ./script9b j
- 106 vim script9b
- 107 ./script9b blah
- 108 ./script9b /etc
- 109 ./script9b /etc/hosts
- 110 vim script9b
- 111 ./script9b /etc
- 112 ./script9b /etc/hosts
- 113 vim script9b
- 114 ./script9b /etc/hosts
- 115 vim script9b
- 116 ./script9b /etc/hosts
- 117 vim script9b
- 118 [-f /etc/hosts] && echo its a file
- 119 history
- 120 cat script9b
- 121 vim script10
- 122 ./countdown 12
- 123 vim script10
- 124 ./script10
- 125 bash -x script10
- 126 vim script10
- 127 ./script10
- 128 bash -x ./script10
- 129 vim script10
- 130 ./script10 1
- 131 vim script10
- 132 ./script10 1
- 133 vim script10
- 134 ./script10 5
- 135 vim script10
- 136 man test
- 137 vim script10
- 138 vim script11
- 139 ./script11
- 140 vim script11
- 141 echo hello | tr a-z A-Z
- 142 echo hello | tr [:lower:] [:upper:]
- 143 vim script11
- 144 ./script11
- 145 vim script11
- 146 vim script11b
- 147 chmod +x script11b
- 148 ./script11b
- 149 vim script11
- 150 ls
- 151 vim reboot-test.sh
- 152 sudo reboot-test.sh
- 153 sudo -i
- 154 cd bash-scripting/
- 155 ls
- 156 cat reboot-test.sh
- 157 history
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement