最后活跃于 1736948811

修订 c785e521cc42a811fcefb298bc470d74ab78f363

installation.sh 原始文件
1#!/bin/bash
2
3# Kolla om till exempel qimgv är installerat eller inte
4
5# VARIABLES
6dir_home='/home/airikr'
7dir_backup='backup-ssd-dir'
8YELLOW='\033[1;33m'
9BLUE='\033[0;34m'
10NC='\033[0m'
11SLEEP='.5'
12
13# COPY > PASTE
14echo && printf "${YELLOW}Restoring bash files" && printf "${NC}" && echo && echo && sleep .5
15sudo rsync -aP "${dir_backup}"/"${dir_home}"/.bashrc "${dir_home}"/
16sudo rsync -aP "${dir_backup}"/"${dir_home}"/.bash_aliases "${dir_home}"/
17sudo rsync -aP "${dir_backup}"/"$dir_home"/systembackup.sh "$dir_home"/
18sudo rsync -aP "${dir_backup}"/"$dir_home"/transferphotos-card.sh "${dir_home}"/
19sudo rsync -aP "${dir_backup}"/"${dir_home}"/transferphotos-ext.sh "${dir_home}"/
20sudo rsync -aP "${dir_backup}"/"${dir_home}"/transferphotos-ext.sh "${dir_home}"/
21
22echo && printf "${YELLOW}Restoring the fstab file" && printf "${NC}" && echo && echo && sleep .5
23sudo cp /etc/fstab /etc/fstab.bak
24sudo rsync -aP "${dir_backup}"/etc/fstab /etc/
25
26echo && printf "${YELLOW}Sourcing the bash_aliases file" && printf "${NC}" && echo && echo && sleep ${SLEEP}
27source "${dir_home}"/.bash_aliases
28
29# UNINSTALL
30echo && printf "${YELLOW}Uninstalling bloatware" && printf "${NC}" && echo && echo && sleep .5
31which parole | grep -o parole > /dev/null && sudo pacman -Rcns parole || echo '${BLUE}parole is not installed${NC}'
32which firewalld | grep -o firewalld > /dev/null && sudo pacman -Rcns firewalld || echo '${BLUE}firewalld is not installed${NC}'
33which galculator | grep -o galculator > /dev/null && sudo pacman -Rcns galculator || echo '${BLUE}galculator is not installed${NC}'
34which ristretto | grep -o ristretto > /dev/null && sudo pacman -Rcns ristretto || echo '${BLUE}ristretto is not installed${NC}'
35which cmake | grep -o cmake > /dev/null && sudo pacman -Rcns cmake || echo '${BLUE}cmake is not installed${NC}'
36which eos-quickstart | grep -o eos-quickstart > /dev/null && sudo pacman -Rcns eos-quickstart || echo '${BLUE}eos-quickstart is not installed${NC}'
37which eos-apps-info | grep -o eos-apps-info > /dev/null && sudo pacman -Rcns eos-apps-info || echo '${BLUE}eos-apps-info is not installed${NC}'
38which welcome | grep -o welcome > /dev/null && sudo pacman -Rcns welcome || echo '${BLUE}welcome is not installed${NC}'
39
40# UPDATE
41echo && printf "${YELLOW}Updating" && printf "${NC}" && echo && echo && sleep ${SLEEP}
42yay -Syu --noconfirm
43
44# INSTALL
45echo && printf "${YELLOW}Installing softwares" && printf "${NC}" && echo && echo && sleep ${SLEEP}
46yay -S --noconfirm mullvad-vpn-bin vscodium-bin qimgv-git ttf-victor-mono smartgit blue-recorder-git josm-stable xfce4-panel-profiles lite-xl-bin
47sudo pacman -S thunderbird darktable gramps steam inter-font mpv obs-studio filezilla element-desktop mumble speedcrunch virtualbox ufw sshfs python-pip gtk2 ttc-iosevka kcolorchooser skanlite yt-dlp openssh wine qmmp gimp shotcut qbittorrent inkscape gamemode lib32-gamemode krita cifs-utils gajim jellyfin-server jellyfin-web syncthing telegram-desktop
48wget -O - https://raw.githubusercontent.com/laurent22/joplin/dev/Joplin_install_and_update.sh | bash
49
50# CREATE FOLDER
51echo && printf "${YELLOW}Creating missing folders" && printf "${NC}" && echo && echo && sleep ${SLEEP}
52sudo mkdir /mnt/Backup
53sudo mkdir /mnt/NAS
54sudo mkdir /mnt/Synology
55
56# INSTALL GRAPHIC DRIVERS
57echo && printf "${YELLOW}Installing graphic cards stuff" && printf "${NC}" && echo && echo && sleep ${SLEEP}
58install_no nvidia nvidia-settings nvidia-utils lib32-nvidia-utils lib32-opencl-nvidia opencl-nvidia libvdpau libxnvctrl vulkan-icd-loader lib32-vulkan-icd-loader
59
60# CONFIG
61echo && printf "${YELLOW}Configuring the graphic card" && printf "${NC}" && echo && echo && sleep ${SLEEP}
62sudo nvidia-xconfig
63sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.d/20-nvidia.conf
64
65
66
67# COPY > PASTE
68echo && printf "${YELLOW}Restoring backed up files" && printf "${NC}" && echo && echo && sleep ${SLEEP}
69sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/darktable/ "${dir_home}"/.config/darktable/
70sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/mpv/ "${dir_home}"/.config/mpv/
71sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/'Mullvad VPN'/ "${dir_home}"/.config/'Mullvad VPN'/
72sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/qimgv/ "${dir_home}"/.config/qimgv/
73sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/obs-studio/ "${dir_home}"/.config/obs-studio/
74sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/smartgit/ "${dir_home}"/.config/smartgit/
75sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/filezilla/ "${dir_home}"/.config/filezilla/
76sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/GIMP/ "${dir_home}"/.config/GIMP/
77sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/FreeFileSync/ "${dir_home}"/.config/FreeFileSync/
78sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/JOSM/ "${dir_home}"/.config/JOSM/
79sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/Joplin/ "${dir_home}"/.config/Joplin/
80sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/joplin-desktop/ "${dir_home}"/.config/joplin-desktop/
81sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/SpeedCrunch/ "${dir_home}"/.config/SpeedCrunch/
82sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/VSCodium/ "${dir_home}"/.config/VSCodium/
83sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/VirtualBox/ "${dir_home}"/.config/VirtualBox/
84sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/qBittorrent/ "${dir_home}"/.config/qBittorrent/
85sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/lite-xl/ "${dir_home}"/.config/lite-xl/
86sudo rsync -aP "${dir_backup}"/"${dir_home}"/.mozilla/firefox/ "${dir_home}"/.mozilla/firefox/
87
88sudo rsync -aP "${dir_backup}"/"${dir_home}"/.thunderbird/ "${dir_home}"/.thunderbird/
89sudo rsync -aP "${dir_backup}"/"${dir_home}"/.joplin/ "${dir_home}"/.joplin/
90sudo rsync -aP "${dir_backup}"/"${dir_home}"/.vscode-oss/ "${dir_home}"/.vscode-oss/
91
92sudo rsync -aP "${dir_backup}"/"${dir_home}"/Pictures/Wallpapers/ "${dir_home}"/Pictures/Wallpapers/
93sudo rsync -aP "${dir_backup}"/"${dir_home}"/Documents/ "${dir_home}"/Documents/
94
95
96
97# JELLYFIN
98echo && printf "${YELLOW}Configuring Jellyfin" && printf "${NC}" && echo && echo && sleep ${SLEEP}
99sudo rsync -aP "${dir_backup}"/var/lib/jellyfin/ /var/lib/jellyfin/
100sudo chown -R jellyfin:jellyfin /var/lib/jellyfin/ sudo chmod -R 777 /var/lib/jellyfin/
101sudo systemctl restart jellyfin.service
102
103
104
105# APACHE
106echo && printf "${YELLOW}Installing Apache" && printf "${NC}" && echo && echo && sleep ${SLEEP}
107sudo pacman -Sy apache
108
109# MYSQL
110echo && printf "${YELLOW}Installing MariaDB" && printf "${NC}" && echo && echo && sleep ${SLEEP}
111sudo pacman -Sy mariadb
112sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
113sudo systemctl start mariadb.service
114sudo mysql_secure_installation
115
116# PHP
117echo && printf "${YELLOW}Installing PHP" && printf "${NC}" && echo && echo && sleep ${SLEEP}
118sudo pacman -Sy php php-apache php-gd php-fpm php-sqlite
119
120# ENABLE BOOT
121echo && printf "${YELLOW}Enabling services for boot" && printf "${NC}" && echo && echo && sleep ${SLEEP}
122sudo systemctl enable mysqld httpd sshd jellyfin syncthing@airikr.service
123
124# START
125echo && printf "${YELLOW}Starting SSH & Syncthing" && printf "${NC}" && echo && echo
126sudo systemctl start sshd syncthing@airikr.service
127
128# COMPOSER
129echo && printf "${YELLOW}Installing Composer" && printf "${NC}" && echo && echo && sleep ${SLEEP}
130php -r 'copy('https://getcomposer.org/installer', 'composer-setup.php');'
131php -r 'if (hash_file('sha384', 'composer-setup.php') === 'e21205b207c3ff031906575712edab6f13eb0b361f2085f1f1237b7126d785e826a450292b6cfd1d64d92e6563bbde02') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;'
132php composer-setup.php
133php -r 'unlink('composer-setup.php');'
134sudo mv composer.phar /usr/local/bin/composer
135
136# COPY > PASTE
137echo && printf "${YELLOW}Restoring configuration files for web server" && printf "${NC}" && echo && echo && sleep ${SLEEP}
138sudo rsync -aP "${dir_backup}"/etc/httpd/conf/httpd.conf /etc/httpd/conf/
139sudo rsync -aP "${dir_backup}"/etc/httpd/conf/extra/phpmyadmin.conf /etc/httpd/conf/extra/
140sudo rsync -aP "${dir_backup}"/etc/php/php.ini /etc/php/
141
142echo && printf "${YELLOW}Restoring website projects" && printf "${NC}" && echo && echo && sleep ${SLEEP}
143sudo rsync -aP "${dir_backup}"/srv/http/ /srv/http/
144
145# RESTART
146echo && printf "${YELLOW}Restarting Apache" && printf "${NC}" && echo && echo && sleep ${SLEEP}
147sudo systemctl restart httpd.service
148
149# INSTRUCTIONS
150printf "${BLUE}"
151echo
152echo '--------'
153echo
154echo 'sudo mysql'
155echo 'ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('password');' # Only if root's password is wrong.
156echo 'quit'
157echo 'mysql -u root -p'
158echo 'CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';'
159echo 'GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost';'
160echo 'quit'
161echo
162echo '--------'
163echo
164echo 'sudo nano /etc/X11/xorg.conf.d/20-nvidia.conf'
165echo 'Follow the instructions below NVIDIA Improvements at https://steamcommunity.com/sharedfiles/filedetails/?id=1787799592'
166echo
167echo 'Download FreeFileSync at https://freefilesync.org/'
168echo
169printf "${NC}"