installation.sh
· 14 KiB · Bash
Raw
#!/bin/bash
# VARIABLES
dir_home='/home/{username}'
dir_backup='/to/dir'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
SLEEP='.5'
# RESTORE FILES
echo && printf "${YELLOW}Restoring bash files" && printf "${NC}" && echo && echo && sleep .5
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.bashrc "${dir_home}"/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.bash_aliases "${dir_home}"/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/systembackup.sh "$dir_home"/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/transferphotos-card.sh "${dir_home}"/
echo && printf "${GREEN}Done restoring the bash files" && printf "${NC}" && echo && echo && sleep .5
echo && printf "${YELLOW}Restoring the fstab file" && printf "${NC}" && echo && echo && sleep .5
if [ ! -f /etc/fstab.bak ]; then
echo && printf "${YELLOW}Backing up the file" && printf "${NC}" && echo && echo && sleep .5
sudo cp /etc/fstab /etc/fstab.bak
fi
sudo rsync -aP "${dir_backup}"/etc/fstab /etc/
echo && printf "${GREEN}Done restoring the fstab file" && printf "${NC}" && echo && echo && sleep .5
echo && printf "${YELLOW}Sourcing the bash_aliases file" && printf "${NC}" && echo && echo && sleep ${SLEEP}
source "${dir_home}"/.bash_aliases
echo && printf "${GREEN}Done" && printf "${NC}" && echo && echo && sleep .5
# UNINSTALL
echo && printf "${YELLOW}Uninstalling bloatware" && printf "${NC}" && echo && echo && sleep .5
which parole | grep -o parole > /dev/null && sudo pacman -Rcns parole || echo '${BLUE}parole is not installed${NC}'
which firewalld | grep -o firewalld > /dev/null && sudo pacman -Rcns firewalld || echo '${BLUE}firewalld is not installed${NC}'
which galculator | grep -o galculator > /dev/null && sudo pacman -Rcns galculator || echo '${BLUE}galculator is not installed${NC}'
which ristretto | grep -o ristretto > /dev/null && sudo pacman -Rcns ristretto || echo '${BLUE}ristretto is not installed${NC}'
which cmake | grep -o cmake > /dev/null && sudo pacman -Rcns cmake || echo '${BLUE}cmake is not installed${NC}'
which eos-quickstart | grep -o eos-quickstart > /dev/null && sudo pacman -Rcns eos-quickstart || echo '${BLUE}eos-quickstart is not installed${NC}'
which 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}'
which eos-welcome | grep -o eos-welcome > /dev/null && sudo pacman -Rcns eos-welcome || echo '${BLUE}eos-welcome is not installed${NC}'
which file-roller | grep -o file-roller > /dev/null && sudo pacman -Rcns file-roller || echo '${BLUE}file-roller is not installed${NC}'
echo && printf "${GREEN}Bloatware uninstalled" && printf "${NC}" && echo && echo && sleep .5
# UPDATE
echo && printf "${YELLOW}Updating" && printf "${NC}" && echo && echo && sleep ${SLEEP}
yay -Syu --noconfirm
echo && printf "${GREEN}System is now up-to-date" && printf "${NC}" && echo && echo && sleep .5
# INSTALL
echo && printf "${YELLOW}Installing softwares" && printf "${NC}" && echo && echo && sleep ${SLEEP}
echo && printf "${YELLOW}Starting with installing softwares with yay" && printf "${NC}" && echo && echo && sleep .5
yay -S --noconfirm mullvad-vpn-bin \
vscodium-bin \
qimgv-git \
ttf-victor-mono \
smartgit \
blue-recorder-git \
xfce4-panel-profiles \
hoptodesk \
jotta-cli
echo && printf "${YELLOW}And now installing softwares with pacman" && printf "${NC}" && echo && echo && sleep .5
sudo pacman -S thunderbird \
darktable \
gramps \
steam \
inter-font \
mpv \
obs-studio \
filezilla \
mumble \
speedcrunch \
virtualbox \
ufw \
sshfs \
python-pip \
gtk2 \
ttc-iosevka \
kcolorchooser \
skanlite \
yt-dlp \
papirus-icon-theme \
openssh \
wine \
qmmp \
gimp \
shotcut \
qbittorrent \
inkscape \
lutris \
krita \
cifs-utils \
gajim \
jellyfin-server \
jellyfin-web \
vivaldi \
syncthing \
telegram-desktop \
gparted \
perl-image-exiftool \
npm \
lite-xl \
archlinux-keyring \
xarchiver
echo && printf "${GREEN}Softwares installed" && printf "${NC}" && echo && echo && sleep .5
echo && printf "${YELLOW}Installing Joplin" && printf "${NC}" && echo && echo && sleep .5
wget -O - https://raw.githubusercontent.com/laurent22/joplin/dev/Joplin_install_and_update.sh | bash
echo && printf "${GREEN}Joplin installed" && printf "${NC}" && echo && echo && sleep .5
# CREATE FOLDER
echo && printf "${YELLOW}Creating missing folders" && printf "${NC}" && sleep ${SLEEP}
if [ ! -d "/mnt/Backup" ]; then
echo && printf "${GREEN}Created /mnt/Backup" && printf "${NC}" && sleep .5
sudo mkdir /mnt/Backup
else
echo && printf "${BLUE}/mnt/Backup already exists" && printf "${NC}" && sleep .5
fi
if [ ! -d "/mnt/NAS" ]; then
echo && printf "${GREEN}Created /mnt/NAS" && printf "${NC}" && sleep .5
sudo mkdir /mnt/NAS
else
echo && printf "${BLUE}/mnt/NAS already exists" && printf "${NC}" && sleep .5
fi
if [ ! -d "/mnt/Synology" ]; then
echo && printf "${GREEN}Created /mnt/Synology" && printf "${NC}" && sleep .5
sudo mkdir /mnt/Synology
else
echo && printf "${BLUE}/mnt/Synology already exists" && printf "${NC}" && sleep .5
fi
echo && printf "${GREEN}Done" && printf "${NC}" && echo && echo && sleep .5
# INSTALL GRAPHIC DRIVERS
echo && printf "${YELLOW}Installing graphic card stuff" && printf "${NC}" && echo && echo && sleep ${SLEEP}
install_no nvidia nvidia-settings nvidia-utils lib32-nvidia-utils lib32-opencl-nvidia opencl-nvidia libvdpau libxnvctrl vulkan-icd-loader lib32-vulkan-icd-loader
echo && printf "${GREEN}Done installing graphic card stuff" && printf "${NC}" && echo && echo && sleep .5
# CONFIG
echo && printf "${YELLOW}Configuring the graphic card" && printf "${NC}" && echo && echo && sleep ${SLEEP}
sudo nvidia-xconfig
sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.d/20-nvidia.conf
echo && printf "${GREEN}Done configurating the graphic card" && printf "${NC}" && echo && echo && sleep .5
# STORE DATA
echo && printf "${YELLOW}Restoring backed up files" && printf "${NC}" && echo && echo && sleep ${SLEEP}
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/darktable/ "${dir_home}"/.config/darktable/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/mpv/ "${dir_home}"/.config/mpv/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/'Mullvad VPN'/ "${dir_home}"/.config/'Mullvad VPN'/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/qimgv/ "${dir_home}"/.config/qimgv/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/obs-studio/ "${dir_home}"/.config/obs-studio/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/smartgit/ "${dir_home}"/.config/smartgit/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/filezilla/ "${dir_home}"/.config/filezilla/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/GIMP/ "${dir_home}"/.config/GIMP/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/FreeFileSync/ "${dir_home}"/.config/FreeFileSync/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/JOSM/ "${dir_home}"/.config/JOSM/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/Joplin/ "${dir_home}"/.config/Joplin/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/joplin-desktop/ "${dir_home}"/.config/joplin-desktop/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/SpeedCrunch/ "${dir_home}"/.config/SpeedCrunch/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/VSCodium/ "${dir_home}"/.config/VSCodium/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/VirtualBox/ "${dir_home}"/.config/VirtualBox/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/qBittorrent/ "${dir_home}"/.config/qBittorrent/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/lite-xl/ "${dir_home}"/.config/lite-xl/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/qmmp/ "${dir_home}"/.config/qmmp/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/Mumble/ "${dir_home}"/.config/Mumble/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/vivaldi/ "${dir_home}"/.config/vivaldi/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/hoptodesk/ "${dir_home}"/.config/hoptodesk/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.local/share/gramps/ "${dir_home}"/.local/share/gramps/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.local/share/TelegramDesktop/ "${dir_home}"/.local/share/TelegramDesktop/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.local/share/Steam/ "${dir_home}"/.local/share/Steam/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.local/share/lutris/ "${dir_home}"/.local/share/lutris/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.local/state/syncthing/ "${dir_home}"/.local/state/syncthing/
sudo rsync -aP --delete "${dir_backup}"/"${dir_home}"/.mozilla/firefox/ "${dir_home}"/.mozilla/firefox/
sudo rsync -aP --delete "${dir_backup}"/"${dir_home}"/.thunderbird/ "${dir_home}"/.thunderbird/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.joplin/ "${dir_home}"/.joplin/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/.vscode-oss/ "${dir_home}"/.vscode-oss/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/Pictures/Wallpapers/ "${dir_home}"/Pictures/Wallpapers/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/Documents/ "${dir_home}"/Documents/
echo && printf "${GREEN}Done restoring files" && printf "${NC}" && echo && echo && sleep .5
# JELLYFIN
echo && printf "${YELLOW}Configuring Jellyfin" && printf "${NC}" && echo && echo && sleep ${SLEEP}
sudo rsync -aP "${dir_backup}"/var/lib/jellyfin/ /var/lib/jellyfin/
sudo chown -R jellyfin:jellyfin /var/lib/jellyfin/
sudo chmod -R 777 /var/lib/jellyfin/
sudo systemctl restart jellyfin.service
echo && printf "${GREEN}Done configuring Jellyfin" && printf "${NC}" && echo && echo && sleep .5
# APACHE
echo && printf "${YELLOW}Installing Apache" && printf "${NC}" && echo && echo && sleep ${SLEEP}
sudo pacman -Sy apache
echo && printf "${GREEN}Done installing Apache" && printf "${NC}" && echo && echo && sleep .5
# MYSQL
echo && printf "${YELLOW}Installing MariaDB" && printf "${NC}" && echo && echo && sleep ${SLEEP}
sudo pacman -Sy mariadb
sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
sudo systemctl start mariadb.service
sudo mysql_secure_installation
echo && printf "${GREEN}Done installing MariaDB" && printf "${NC}" && echo && echo && sleep .5
# PHP
echo && printf "${YELLOW}Installing PHP" && printf "${NC}" && echo && echo && sleep ${SLEEP}
sudo pacman -Sy php php-apache php-gd php-fpm php-sqlite
echo && printf "${GREEN}Done installing PHP" && printf "${NC}" && echo && echo && sleep .5
# ENABLE BOOT
echo && printf "${YELLOW}Enabling services for boot" && printf "${NC}" && echo && echo && sleep ${SLEEP}
sudo systemctl enable mysqld httpd sshd jellyfin syncthing@airikr.service
echo && printf "${GREEN}Done" && printf "${NC}" && echo && echo && sleep .5
# START
echo && printf "${YELLOW}Starting SSH & Syncthing" && printf "${NC}" && echo && echo
sudo systemctl start sshd syncthing@airikr.service
echo && printf "${GREEN}Done" && printf "${NC}" && echo && echo && sleep .5
# COMPOSER
echo && printf "${YELLOW}Installing Composer" && printf "${NC}" && echo && echo && sleep ${SLEEP}
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer
echo && printf "${GREEN}Done installing Composer" && printf "${NC}" && echo && echo && sleep .5
# GEOSPATIAL
#git clone https://github.com/php-geospatial/geospatial.git
#cd geospatial
#phpize
#./configure --enable-geospatial
#make
#sudo make install
# RESTORE WEB SERVER FILES
echo && printf "${YELLOW}Restoring configuration files for the web server" && printf "${NC}" && echo && echo && sleep ${SLEEP}
sudo rsync -aP "${dir_backup}"/etc/httpd/conf/httpd.conf /etc/httpd/conf/
sudo rsync -aP "${dir_backup}"/etc/httpd/conf/extra/phpmyadmin.conf /etc/httpd/conf/extra/
sudo rsync -aP "${dir_backup}"/etc/php/php.ini /etc/php/
echo && printf "${GREEN}Done restoring configuration files for the web server" && printf "${NC}" && echo && echo && sleep .5
echo && printf "${YELLOW}Restoring website projects" && printf "${NC}" && echo && echo && sleep ${SLEEP}
sudo rsync -aP "${dir_backup}"/srv/http/ /srv/http/
echo && printf "${GREEN}Done restoring website projects" && printf "${NC}" && echo && echo && sleep .5
# RESTART
echo && printf "${YELLOW}Restarting Apache" && printf "${NC}" && echo && echo && sleep ${SLEEP}
sudo systemctl restart httpd.service
echo && printf "${GREEN}Done" && printf "${NC}" && echo && echo && sleep .5
# ADDING USER
echo && printf "${YELLOW}Adding vboxusers to the user group" && printf "${NC}" && echo && echo && sleep ${SLEEP}
sudo usermod -a -G vboxusers $USER
echo && printf "${GREEN}Done. Log out and log back in to enable vboxusers" && printf "${NC}" && echo && echo && sleep .5
# CONFIGURE JOTTA-CLI
echo && printf "${YELLOW}Configuring jotta-cli" && printf "${NC}" && echo && echo && sleep ${SLEEP}
run_jottad
jotta-cli login
jotta-cli sync setup --root /mnt/ExtSSD/JottaSync/
jotta-cli sync start
jotta-cli sync status
jotta-cli add '/home/{username}/'
echo && printf "${YELLOW}Run jotta-cli scan to start the scanning" && printf "${NC}" && echo && echo && sleep .5
echo && printf "${GREEN}All done!" && printf "${NC}"
# Log out and log back in again to enable vboxusers
# Download FreeFileSync at https://freefilesync.org/
# Use the following if root's password is wrong
# sudo mysql
# ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('password');
# quit
# Connect to MySQL with the root user
# /usr/bin/mariadb -u root -p
# To create a new user and grant all privileges
# CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
# GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost';
# To change the username
# RENAME USER 'user'@'localhost' to 'new-user'@'localhost';
# To change the password
# ALTER USER 'user'@'localhost' IDENTIFIED BY 'new-password';
# quit
# sudo nano /etc/X11/xorg.conf.d/20-nvidia.conf
# If anything, install gamemode and lib32-gamemode
# Follow the instructions below NVIDIA Improvements at https://steamcommunity.com/sharedfiles/filedetails/?id=1787799592
1 | #!/bin/bash |
2 | |
3 | # VARIABLES |
4 | dir_home='/home/{username}' |
5 | dir_backup='/to/dir' |
6 | GREEN='\033[0;32m' |
7 | YELLOW='\033[1;33m' |
8 | BLUE='\033[0;34m' |
9 | NC='\033[0m' |
10 | SLEEP='.5' |
11 | |
12 | # RESTORE FILES |
13 | echo && printf "${YELLOW}Restoring bash files" && printf "${NC}" && echo && echo && sleep .5 |
14 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.bashrc "${dir_home}"/ |
15 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.bash_aliases "${dir_home}"/ |
16 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/systembackup.sh "$dir_home"/ |
17 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/transferphotos-card.sh "${dir_home}"/ |
18 | echo && printf "${GREEN}Done restoring the bash files" && printf "${NC}" && echo && echo && sleep .5 |
19 | |
20 | |
21 | |
22 | echo && printf "${YELLOW}Restoring the fstab file" && printf "${NC}" && echo && echo && sleep .5 |
23 | if [ ! -f /etc/fstab.bak ]; then |
24 | echo && printf "${YELLOW}Backing up the file" && printf "${NC}" && echo && echo && sleep .5 |
25 | sudo cp /etc/fstab /etc/fstab.bak |
26 | fi |
27 | |
28 | sudo rsync -aP "${dir_backup}"/etc/fstab /etc/ |
29 | echo && printf "${GREEN}Done restoring the fstab file" && printf "${NC}" && echo && echo && sleep .5 |
30 | |
31 | |
32 | |
33 | echo && printf "${YELLOW}Sourcing the bash_aliases file" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
34 | source "${dir_home}"/.bash_aliases |
35 | echo && printf "${GREEN}Done" && printf "${NC}" && echo && echo && sleep .5 |
36 | |
37 | |
38 | |
39 | # UNINSTALL |
40 | echo && printf "${YELLOW}Uninstalling bloatware" && printf "${NC}" && echo && echo && sleep .5 |
41 | which parole | grep -o parole > /dev/null && sudo pacman -Rcns parole || echo '${BLUE}parole is not installed${NC}' |
42 | which firewalld | grep -o firewalld > /dev/null && sudo pacman -Rcns firewalld || echo '${BLUE}firewalld is not installed${NC}' |
43 | which galculator | grep -o galculator > /dev/null && sudo pacman -Rcns galculator || echo '${BLUE}galculator is not installed${NC}' |
44 | which ristretto | grep -o ristretto > /dev/null && sudo pacman -Rcns ristretto || echo '${BLUE}ristretto is not installed${NC}' |
45 | which cmake | grep -o cmake > /dev/null && sudo pacman -Rcns cmake || echo '${BLUE}cmake is not installed${NC}' |
46 | which eos-quickstart | grep -o eos-quickstart > /dev/null && sudo pacman -Rcns eos-quickstart || echo '${BLUE}eos-quickstart is not installed${NC}' |
47 | which 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}' |
48 | which eos-welcome | grep -o eos-welcome > /dev/null && sudo pacman -Rcns eos-welcome || echo '${BLUE}eos-welcome is not installed${NC}' |
49 | which file-roller | grep -o file-roller > /dev/null && sudo pacman -Rcns file-roller || echo '${BLUE}file-roller is not installed${NC}' |
50 | echo && printf "${GREEN}Bloatware uninstalled" && printf "${NC}" && echo && echo && sleep .5 |
51 | |
52 | |
53 | |
54 | # UPDATE |
55 | echo && printf "${YELLOW}Updating" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
56 | yay -Syu --noconfirm |
57 | echo && printf "${GREEN}System is now up-to-date" && printf "${NC}" && echo && echo && sleep .5 |
58 | |
59 | |
60 | |
61 | # INSTALL |
62 | echo && printf "${YELLOW}Installing softwares" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
63 | echo && printf "${YELLOW}Starting with installing softwares with yay" && printf "${NC}" && echo && echo && sleep .5 |
64 | yay -S --noconfirm mullvad-vpn-bin \ |
65 | vscodium-bin \ |
66 | qimgv-git \ |
67 | ttf-victor-mono \ |
68 | smartgit \ |
69 | blue-recorder-git \ |
70 | xfce4-panel-profiles \ |
71 | hoptodesk \ |
72 | jotta-cli |
73 | |
74 | echo && printf "${YELLOW}And now installing softwares with pacman" && printf "${NC}" && echo && echo && sleep .5 |
75 | sudo pacman -S thunderbird \ |
76 | darktable \ |
77 | gramps \ |
78 | steam \ |
79 | inter-font \ |
80 | mpv \ |
81 | obs-studio \ |
82 | filezilla \ |
83 | mumble \ |
84 | speedcrunch \ |
85 | virtualbox \ |
86 | ufw \ |
87 | sshfs \ |
88 | python-pip \ |
89 | gtk2 \ |
90 | ttc-iosevka \ |
91 | kcolorchooser \ |
92 | skanlite \ |
93 | yt-dlp \ |
94 | papirus-icon-theme \ |
95 | openssh \ |
96 | wine \ |
97 | qmmp \ |
98 | gimp \ |
99 | shotcut \ |
100 | qbittorrent \ |
101 | inkscape \ |
102 | lutris \ |
103 | krita \ |
104 | cifs-utils \ |
105 | gajim \ |
106 | jellyfin-server \ |
107 | jellyfin-web \ |
108 | vivaldi \ |
109 | syncthing \ |
110 | telegram-desktop \ |
111 | gparted \ |
112 | perl-image-exiftool \ |
113 | npm \ |
114 | lite-xl \ |
115 | archlinux-keyring \ |
116 | xarchiver |
117 | |
118 | echo && printf "${GREEN}Softwares installed" && printf "${NC}" && echo && echo && sleep .5 |
119 | |
120 | echo && printf "${YELLOW}Installing Joplin" && printf "${NC}" && echo && echo && sleep .5 |
121 | wget -O - https://raw.githubusercontent.com/laurent22/joplin/dev/Joplin_install_and_update.sh | bash |
122 | echo && printf "${GREEN}Joplin installed" && printf "${NC}" && echo && echo && sleep .5 |
123 | |
124 | |
125 | |
126 | # CREATE FOLDER |
127 | echo && printf "${YELLOW}Creating missing folders" && printf "${NC}" && sleep ${SLEEP} |
128 | |
129 | if [ ! -d "/mnt/Backup" ]; then |
130 | echo && printf "${GREEN}Created /mnt/Backup" && printf "${NC}" && sleep .5 |
131 | sudo mkdir /mnt/Backup |
132 | else |
133 | echo && printf "${BLUE}/mnt/Backup already exists" && printf "${NC}" && sleep .5 |
134 | fi |
135 | |
136 | if [ ! -d "/mnt/NAS" ]; then |
137 | echo && printf "${GREEN}Created /mnt/NAS" && printf "${NC}" && sleep .5 |
138 | sudo mkdir /mnt/NAS |
139 | else |
140 | echo && printf "${BLUE}/mnt/NAS already exists" && printf "${NC}" && sleep .5 |
141 | fi |
142 | |
143 | if [ ! -d "/mnt/Synology" ]; then |
144 | echo && printf "${GREEN}Created /mnt/Synology" && printf "${NC}" && sleep .5 |
145 | sudo mkdir /mnt/Synology |
146 | else |
147 | echo && printf "${BLUE}/mnt/Synology already exists" && printf "${NC}" && sleep .5 |
148 | fi |
149 | |
150 | echo && printf "${GREEN}Done" && printf "${NC}" && echo && echo && sleep .5 |
151 | |
152 | |
153 | |
154 | # INSTALL GRAPHIC DRIVERS |
155 | echo && printf "${YELLOW}Installing graphic card stuff" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
156 | install_no nvidia nvidia-settings nvidia-utils lib32-nvidia-utils lib32-opencl-nvidia opencl-nvidia libvdpau libxnvctrl vulkan-icd-loader lib32-vulkan-icd-loader |
157 | echo && printf "${GREEN}Done installing graphic card stuff" && printf "${NC}" && echo && echo && sleep .5 |
158 | |
159 | |
160 | |
161 | # CONFIG |
162 | echo && printf "${YELLOW}Configuring the graphic card" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
163 | sudo nvidia-xconfig |
164 | sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.d/20-nvidia.conf |
165 | echo && printf "${GREEN}Done configurating the graphic card" && printf "${NC}" && echo && echo && sleep .5 |
166 | |
167 | |
168 | |
169 | # STORE DATA |
170 | echo && printf "${YELLOW}Restoring backed up files" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
171 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/darktable/ "${dir_home}"/.config/darktable/ |
172 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/mpv/ "${dir_home}"/.config/mpv/ |
173 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/'Mullvad VPN'/ "${dir_home}"/.config/'Mullvad VPN'/ |
174 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/qimgv/ "${dir_home}"/.config/qimgv/ |
175 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/obs-studio/ "${dir_home}"/.config/obs-studio/ |
176 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/smartgit/ "${dir_home}"/.config/smartgit/ |
177 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/filezilla/ "${dir_home}"/.config/filezilla/ |
178 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/GIMP/ "${dir_home}"/.config/GIMP/ |
179 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/FreeFileSync/ "${dir_home}"/.config/FreeFileSync/ |
180 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/JOSM/ "${dir_home}"/.config/JOSM/ |
181 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/Joplin/ "${dir_home}"/.config/Joplin/ |
182 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/joplin-desktop/ "${dir_home}"/.config/joplin-desktop/ |
183 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/SpeedCrunch/ "${dir_home}"/.config/SpeedCrunch/ |
184 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/VSCodium/ "${dir_home}"/.config/VSCodium/ |
185 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/VirtualBox/ "${dir_home}"/.config/VirtualBox/ |
186 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/qBittorrent/ "${dir_home}"/.config/qBittorrent/ |
187 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/lite-xl/ "${dir_home}"/.config/lite-xl/ |
188 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/qmmp/ "${dir_home}"/.config/qmmp/ |
189 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/Mumble/ "${dir_home}"/.config/Mumble/ |
190 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/vivaldi/ "${dir_home}"/.config/vivaldi/ |
191 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/hoptodesk/ "${dir_home}"/.config/hoptodesk/ |
192 | |
193 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.local/share/gramps/ "${dir_home}"/.local/share/gramps/ |
194 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.local/share/TelegramDesktop/ "${dir_home}"/.local/share/TelegramDesktop/ |
195 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.local/share/Steam/ "${dir_home}"/.local/share/Steam/ |
196 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.local/share/lutris/ "${dir_home}"/.local/share/lutris/ |
197 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.local/state/syncthing/ "${dir_home}"/.local/state/syncthing/ |
198 | |
199 | sudo rsync -aP --delete "${dir_backup}"/"${dir_home}"/.mozilla/firefox/ "${dir_home}"/.mozilla/firefox/ |
200 | sudo rsync -aP --delete "${dir_backup}"/"${dir_home}"/.thunderbird/ "${dir_home}"/.thunderbird/ |
201 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.joplin/ "${dir_home}"/.joplin/ |
202 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.vscode-oss/ "${dir_home}"/.vscode-oss/ |
203 | |
204 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/Pictures/Wallpapers/ "${dir_home}"/Pictures/Wallpapers/ |
205 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/Documents/ "${dir_home}"/Documents/ |
206 | echo && printf "${GREEN}Done restoring files" && printf "${NC}" && echo && echo && sleep .5 |
207 | |
208 | |
209 | |
210 | # JELLYFIN |
211 | echo && printf "${YELLOW}Configuring Jellyfin" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
212 | sudo rsync -aP "${dir_backup}"/var/lib/jellyfin/ /var/lib/jellyfin/ |
213 | sudo chown -R jellyfin:jellyfin /var/lib/jellyfin/ |
214 | sudo chmod -R 777 /var/lib/jellyfin/ |
215 | sudo systemctl restart jellyfin.service |
216 | echo && printf "${GREEN}Done configuring Jellyfin" && printf "${NC}" && echo && echo && sleep .5 |
217 | |
218 | |
219 | |
220 | # APACHE |
221 | echo && printf "${YELLOW}Installing Apache" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
222 | sudo pacman -Sy apache |
223 | echo && printf "${GREEN}Done installing Apache" && printf "${NC}" && echo && echo && sleep .5 |
224 | |
225 | |
226 | |
227 | # MYSQL |
228 | echo && printf "${YELLOW}Installing MariaDB" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
229 | sudo pacman -Sy mariadb |
230 | sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql |
231 | sudo systemctl start mariadb.service |
232 | sudo mysql_secure_installation |
233 | echo && printf "${GREEN}Done installing MariaDB" && printf "${NC}" && echo && echo && sleep .5 |
234 | |
235 | |
236 | |
237 | # PHP |
238 | echo && printf "${YELLOW}Installing PHP" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
239 | sudo pacman -Sy php php-apache php-gd php-fpm php-sqlite |
240 | echo && printf "${GREEN}Done installing PHP" && printf "${NC}" && echo && echo && sleep .5 |
241 | |
242 | |
243 | |
244 | # ENABLE BOOT |
245 | echo && printf "${YELLOW}Enabling services for boot" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
246 | sudo systemctl enable mysqld httpd sshd jellyfin syncthing@airikr.service |
247 | echo && printf "${GREEN}Done" && printf "${NC}" && echo && echo && sleep .5 |
248 | |
249 | |
250 | |
251 | # START |
252 | echo && printf "${YELLOW}Starting SSH & Syncthing" && printf "${NC}" && echo && echo |
253 | sudo systemctl start sshd syncthing@airikr.service |
254 | echo && printf "${GREEN}Done" && printf "${NC}" && echo && echo && sleep .5 |
255 | |
256 | |
257 | |
258 | # COMPOSER |
259 | echo && printf "${YELLOW}Installing Composer" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
260 | php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" |
261 | php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" |
262 | php composer-setup.php |
263 | php -r "unlink('composer-setup.php');" |
264 | sudo mv composer.phar /usr/local/bin/composer |
265 | echo && printf "${GREEN}Done installing Composer" && printf "${NC}" && echo && echo && sleep .5 |
266 | |
267 | |
268 | |
269 | # GEOSPATIAL |
270 | #git clone https://github.com/php-geospatial/geospatial.git |
271 | #cd geospatial |
272 | #phpize |
273 | #./configure --enable-geospatial |
274 | #make |
275 | #sudo make install |
276 | |
277 | |
278 | |
279 | # RESTORE WEB SERVER FILES |
280 | echo && printf "${YELLOW}Restoring configuration files for the web server" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
281 | sudo rsync -aP "${dir_backup}"/etc/httpd/conf/httpd.conf /etc/httpd/conf/ |
282 | sudo rsync -aP "${dir_backup}"/etc/httpd/conf/extra/phpmyadmin.conf /etc/httpd/conf/extra/ |
283 | sudo rsync -aP "${dir_backup}"/etc/php/php.ini /etc/php/ |
284 | echo && printf "${GREEN}Done restoring configuration files for the web server" && printf "${NC}" && echo && echo && sleep .5 |
285 | |
286 | echo && printf "${YELLOW}Restoring website projects" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
287 | sudo rsync -aP "${dir_backup}"/srv/http/ /srv/http/ |
288 | echo && printf "${GREEN}Done restoring website projects" && printf "${NC}" && echo && echo && sleep .5 |
289 | |
290 | |
291 | |
292 | # RESTART |
293 | echo && printf "${YELLOW}Restarting Apache" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
294 | sudo systemctl restart httpd.service |
295 | echo && printf "${GREEN}Done" && printf "${NC}" && echo && echo && sleep .5 |
296 | |
297 | |
298 | |
299 | # ADDING USER |
300 | echo && printf "${YELLOW}Adding vboxusers to the user group" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
301 | sudo usermod -a -G vboxusers $USER |
302 | echo && printf "${GREEN}Done. Log out and log back in to enable vboxusers" && printf "${NC}" && echo && echo && sleep .5 |
303 | |
304 | |
305 | |
306 | # CONFIGURE JOTTA-CLI |
307 | echo && printf "${YELLOW}Configuring jotta-cli" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
308 | run_jottad |
309 | jotta-cli login |
310 | jotta-cli sync setup --root /mnt/ExtSSD/JottaSync/ |
311 | jotta-cli sync start |
312 | jotta-cli sync status |
313 | jotta-cli add '/home/{username}/' |
314 | echo && printf "${YELLOW}Run jotta-cli scan to start the scanning" && printf "${NC}" && echo && echo && sleep .5 |
315 | |
316 | echo && printf "${GREEN}All done!" && printf "${NC}" |
317 | |
318 | |
319 | |
320 | # Log out and log back in again to enable vboxusers |
321 | # Download FreeFileSync at https://freefilesync.org/ |
322 | |
323 | # Use the following if root's password is wrong |
324 | # sudo mysql |
325 | # ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('password'); |
326 | # quit |
327 | |
328 | # Connect to MySQL with the root user |
329 | # /usr/bin/mariadb -u root -p |
330 | |
331 | # To create a new user and grant all privileges |
332 | # CREATE USER 'user'@'localhost' IDENTIFIED BY 'password'; |
333 | # GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost'; |
334 | |
335 | # To change the username |
336 | # RENAME USER 'user'@'localhost' to 'new-user'@'localhost'; |
337 | |
338 | # To change the password |
339 | # ALTER USER 'user'@'localhost' IDENTIFIED BY 'new-password'; |
340 | # quit |
341 | |
342 | # sudo nano /etc/X11/xorg.conf.d/20-nvidia.conf |
343 | # If anything, install gamemode and lib32-gamemode |
344 | # Follow the instructions below NVIDIA Improvements at https://steamcommunity.com/sharedfiles/filedetails/?id=1787799592 |