SHARE
TWEET

migrate

a guest Aug 12th, 2019 10 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. clear
  3. grep "Antergos" /etc/*-release > /dev/null 2>&1
  4. if [ $? -eq 1 ]; then echo "Skrypt przeznaczony dla Antergos Linux! BYE!"; exit 1; fi
  5.  
  6. echo -e "\033[1m
  7. SKRYPT NIE GWARANTUJE POPRAWNEGO DZIAŁANIA SYSTEMU PO MIGRACJI Z ANTERGOSA DO ARCH LINUX!!\n
  8. UŻYWASZ NA WŁASNĄ ODPOWIEDZIALNOŚĆ. SKRYPT WYKONUJE PODSTAWOWĄ KOPIĘ MODYFIKOWANYCH PLIKÓW.\n
  9. JEDNAK, ABY JE PRZYWRÓCIĆ TRZEBA ZROBIĆ TO RĘCZNIE. NAJLEPIEJ WYKONAĆ PEŁNĄ KOPIĘ SYSTEMU.\033[0m \n[ Aby przerwać naciśnij Ctrl+C, ENTER - aby kontynuować ]"
  10. read n
  11.  
  12. echo -e "\033[1mLista modyfikowanych plików:\033[0m \n"
  13. echo -e "-> /etc/pacman.conf
  14. -> /etc/os-release
  15. -> /etc/issue
  16. -> /boot/grub/grub.cfg
  17. -> /etc/grub.d/10_antergos <-- USUWANY! \n\n"
  18.  
  19. echo -e "\033[1mLista usuwanych paczek Antergosa (lista bez uwzględniania zależności,\nusuwane będą także osamotnione zależności):\033[0m \n"
  20. pacman -Qq | grep antergos || echo "Brak! (usunięte wcześniej?)"
  21. echo -e "\n\n"
  22.  
  23.  
  24. read -n 1 -p "Wykonać kopię zapasową modyfikowanych plików (t/n)? " odp
  25. case $odp in
  26.     [tT])
  27.             sudo cp -v /etc/pacman.conf /etc/pacman.conf.ANTERGOS
  28.             sudo cp -v /etc/os-release /etc/os-release.ANTERGOS
  29.             sudo cp -v /etc/issue /etc/issue.ANTERGOS
  30.             sudo cp -v /boot/grub/grub.cfg /boot/grub/grub.cfg.ANTERGOS
  31.             sudo cp -v /etc/grub.d/10_antergos /etc/grub.d/_10_antergos.ANTERGOS
  32.             sudo chmod -x /etc/grub.d/_10_antergos.ANTERGOS
  33.             sudo pacman -Qq | grep antergos > ~/antergos_pkglist_$$.txt && echo "Zapisano listę specyficznych paczek Antergosa do pliku ~/antergos_pkglist.txt"
  34.             echo -e "\nKopia modyfikowanych plików wykonana, znajdziesz je z rozszerzeniem '.ANTERGOS'!"
  35.             ;;
  36.     [nN])
  37.             echo -e "\nNie wybrano kopii zapasowej!!"
  38.             ;;
  39.     *)
  40.             echo -e "\nWybierz \"t\" lub \"n\" (tak/nie)!"
  41.             exit 1
  42.             ;;
  43. esac
  44.  
  45.  
  46. tmpfile=`mktemp` || exit 1
  47.  
  48.  
  49. echo -e "-> \033[1mUsuwanie paczek specyficznych dla Antergosa wraz z zależnościami\033[0m\n"
  50. sudo pacman -Rddnus --noconfirm $(pacman -Qq | grep antergos)
  51.  
  52. echo -e "-> \033[1mUsuwanie modyfikacji GRUB Antergos /etc/grub.d/10_antergos\033[0m\n"
  53. sudo rm -v /etc/grub.d/10_antergos
  54.  
  55. echo -e  "-> \033[1mPodmiana zawartości /etc/pacman.conf\033[0m\n"
  56. cat > $tmpfile << "EOF"
  57. #
  58. # /etc/pacman.conf
  59. #
  60. # See the pacman.conf(5) manpage for option and repository directives
  61.  
  62. #
  63. # GENERAL OPTIONS
  64. #
  65. [options]
  66. # The following paths are commented out with their default values listed.
  67. # If you wish to use different paths, uncomment and update the paths.
  68. #RootDir     = /
  69. #DBPath      = /var/lib/pacman/
  70. #CacheDir    = /var/cache/pacman/pkg/
  71. #LogFile     = /var/log/pacman.log
  72. #GPGDir      = /etc/pacman.d/gnupg/
  73. #HookDir     = /etc/pacman.d/hooks/
  74. HoldPkg     = pacman glibc
  75. #XferCommand = /usr/bin/curl -C - -f %u > %o
  76. #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
  77. #CleanMethod = KeepInstalled
  78. #UseDelta    = 0.7
  79. Architecture = auto
  80.  
  81. # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
  82. #IgnorePkg   =
  83. #IgnoreGroup =
  84.  
  85. #NoUpgrade   =
  86. #NoExtract   =
  87.  
  88. # Misc options
  89. #UseSyslog
  90. Color
  91. TotalDownload
  92. CheckSpace
  93. #VerbosePkgLists
  94. ILoveCandy
  95.  
  96. # By default, pacman accepts packages signed by keys that its local keyring
  97. # trusts (see pacman-key and its man page), as well as unsigned packages.
  98. SigLevel    = Required DatabaseOptional
  99. LocalFileSigLevel = Optional
  100. #RemoteFileSigLevel = Required
  101.  
  102. # NOTE: You must run `pacman-key --init` before first using pacman; the local
  103. # keyring can then be populated with the keys of all official Arch Linux
  104. # packagers with `pacman-key --populate archlinux`.
  105.  
  106. #
  107. # REPOSITORIES
  108. #   - can be defined here or included from another file
  109. #   - pacman will search repositories in the order defined here
  110. #   - local/custom mirrors can be added here or in separate files
  111. #   - repositories listed first will take precedence when packages
  112. #     have identical names, regardless of version number
  113. #   - URLs will have $repo replaced by the name of the current repo
  114. #   - URLs will have $arch replaced by the name of the architecture
  115. #
  116. # Repository entries are of the format:
  117. #       [repo-name]
  118. #       Server = ServerName
  119. #       Include = IncludePath
  120. #
  121. # The header [repo-name] is crucial - it must be present and
  122. # uncommented to enable the repo.
  123. #
  124.  
  125. # The testing repositories are disabled by default. To enable, uncomment the
  126. # repo name header and Include lines. You can add preferred servers immediately
  127. # after the header, and they will be used before the default mirrors.
  128.  
  129. #[testing]
  130. #Include = /etc/pacman.d/mirrorlist
  131.  
  132. [core]
  133. Include = /etc/pacman.d/mirrorlist
  134.  
  135. [extra]
  136. Include = /etc/pacman.d/mirrorlist
  137.  
  138. #[community-testing]
  139. #Include = /etc/pacman.d/mirrorlist
  140.  
  141. [community]
  142. Include = /etc/pacman.d/mirrorlist
  143.  
  144. # If you want to run 32 bit applications on your x86_64 system,
  145. # enable the multilib repositories as required here.
  146.  
  147. #[multilib-testing]
  148. #Include = /etc/pacman.d/mirrorlist
  149.  
  150. [multilib]
  151. Include = /etc/pacman.d/mirrorlist
  152.  
  153. # An example of a custom package repository.  See the pacman manpage for
  154. # tips on creating your own repositories.
  155. #[custom]
  156. #SigLevel = Optional TrustAll
  157. #Server = file:///home/custompkgs
  158. EOF
  159. sudo mv -v $tmpfile /etc/pacman.conf
  160.  
  161. echo -e  "-> \033[1mPodmiana zawartości /etc/os-release\033[0m\n"
  162. cat > $tmpfile << "EOF"
  163. NAME="Arch Linux"
  164. PRETTY_NAME="Arch Linux"
  165. ID=arch
  166. BUILD_ID=rolling
  167. ANSI_COLOR="0;36"
  168. HOME_URL="https://www.archlinux.org/"
  169. DOCUMENTATION_URL="https://wiki.archlinux.org/"
  170. SUPPORT_URL="https://bbs.archlinux.org/"
  171. BUG_REPORT_URL="https://bugs.archlinux.org/"
  172. LOGO=archlinux
  173. EOF
  174. sudo mv -v $tmpfile /etc/os-release
  175.  
  176.  
  177. echo -e  "-> \033[1mPodmiana zawartości /etc/issue\033[0m\n"
  178. cat > $tmpfile << "EOF"
  179. Arch Linux \r (\l)
  180.  
  181. EOF
  182. sudo mv -v $tmpfile /etc/issue
  183.  
  184.  
  185. echo -e  "-> \033[1mUsuwanie Pamac\033[0m\n"
  186. kill -s SIGKILL $(pgrep pamac)
  187. sudo pacman --noconfirm --remove -nus pamac
  188.  
  189.  
  190. echo -e  "-> \033[1mUaktualnianie kluczy Pacmana i baz repozytoriów - CIERPLIWOŚCI\033[0m\n"
  191. sudo pacman-key --refresh
  192. sudo pacman -Syy
  193.  
  194. echo -e  "-> \033[1mReinstalacja linux i linux-headers\033[0m\n"
  195. sudo pacman -Syu --noconfirm linux linux-headers
  196.  
  197.  
  198. echo -e  "-> \033[1mReinstalacja GRUB i odświeżenie wpisów w grub.cfg\033[0m\n"
  199. sudo pacman -Syu --noconfirm grub
  200. sudo grub-mkconfig -o /boot/grub/grub.cfg
  201.  
  202.  
  203. echo -e  "-> \033[1mPełna aktualizacja (kontrolnie)\033[0m\n"
  204. sudo sudo pacman -Syyuu --noconfirm
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top