installation.sh
· 9.7 KiB · Bash
原始檔案
#!/bin/bash
# Kolla om till exempel qimgv är installerat eller inte
# VARIABLES
dir_home='/home/airikr'
dir_backup='backup-ssd-dir'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
SLEEP='.5'
# COPY > PASTE
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}"/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/transferphotos-ext.sh "${dir_home}"/
sudo rsync -aP "${dir_backup}"/"${dir_home}"/transferphotos-ext.sh "${dir_home}"/
echo && printf "${YELLOW}Restoring the fstab file" && printf "${NC}" && echo && echo && sleep .5
sudo cp /etc/fstab /etc/fstab.bak
sudo rsync -aP "${dir_backup}"/etc/fstab /etc/
echo && printf "${YELLOW}Sourcing the bash_aliases file" && printf "${NC}" && echo && echo && sleep ${SLEEP}
source "${dir_home}"/.bash_aliases
# 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 welcome | grep -o welcome > /dev/null && sudo pacman -Rcns welcome || echo '${BLUE}welcome is not installed${NC}'
# UPDATE
echo && printf "${YELLOW}Updating" && printf "${NC}" && echo && echo && sleep ${SLEEP}
yay -Syu --noconfirm
# INSTALL
echo && printf "${YELLOW}Installing softwares" && printf "${NC}" && echo && echo && sleep ${SLEEP}
yay -S --noconfirm mullvad-vpn-bin vscodium-bin qimgv-git ttf-victor-mono smartgit blue-recorder-git josm-stable xfce4-panel-profiles xfce4-docklike-plugin
sudo 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 perl-image-exiftool npm lite-xl
wget -O - https://raw.githubusercontent.com/laurent22/joplin/dev/Joplin_install_and_update.sh | bash
# CREATE FOLDER
echo && printf "${YELLOW}Creating missing folders" && printf "${NC}" && echo && echo && sleep ${SLEEP}
sudo mkdir /mnt/Backup
sudo mkdir /mnt/NAS
sudo mkdir /mnt/Synology
# INSTALL GRAPHIC DRIVERS
echo && printf "${YELLOW}Installing graphic cards 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
# 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
# COPY > PASTE
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}"/.mozilla/firefox/ "${dir_home}"/.mozilla/firefox/
sudo rsync -aP "${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/
# 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
# APACHE
echo && printf "${YELLOW}Installing Apache" && printf "${NC}" && echo && echo && sleep ${SLEEP}
sudo pacman -Sy apache
# 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
# PHP
echo && printf "${YELLOW}Installing PHP" && printf "${NC}" && echo && echo && sleep ${SLEEP}
sudo pacman -Sy php php-apache php-gd php-fpm php-sqlite php-pgsql
# 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
# START
echo && printf "${YELLOW}Starting SSH & Syncthing" && printf "${NC}" && echo && echo
sudo systemctl start sshd syncthing@airikr.service
# 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
# GEOSPATIAL
git clone https://github.com/php-geospatial/geospatial.git
cd geospatial
phpize
./configure --enable-geospatial
make
sudo make install
# COPY > PASTE
echo && printf "${YELLOW}Restoring configuration files for 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 "${YELLOW}Restoring website projects" && printf "${NC}" && echo && echo && sleep ${SLEEP}
sudo rsync -aP "${dir_backup}"/srv/http/ /srv/http/
# RESTART
echo && printf "${YELLOW}Restarting Apache" && printf "${NC}" && echo && echo && sleep ${SLEEP}
sudo systemctl restart httpd.service
# ADDING USER
sudo usermod -a -G vboxusers $USER
# INSTRUCTIONS
printf "${BLUE}"
echo
echo '--------'
echo
echo 'Use the following if root's password is wrong'
echo 'sudo mysql'
echo 'ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('password');'
echo 'quit'
echo
echo '--------'
echo
echo 'Connect to MySQL with the root user'
echo '/usr/bin/mariadb -u root -p'
echo
echo 'To create a new user and grant all privileges'
echo 'CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';'
echo 'GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost';'
echo
echo 'To change the username'
echo 'RENAME USER 'user'@'localhost' to 'new-user'@'localhost';'
echo
echo 'To change the password'
echo 'ALTER USER 'user'@'localhost' IDENTIFIED BY 'new-password';'
echo
echo 'quit'
echo
echo '--------'
echo
echo 'sudo nano /etc/X11/xorg.conf.d/20-nvidia.conf'
echo 'Follow the instructions below NVIDIA Improvements at https://steamcommunity.com/sharedfiles/filedetails/?id=1787799592'
echo
echo 'Download FreeFileSync at https://freefilesync.org/'
echo
echo 'Log out and log back in again to enable vboxusers'
printf "${NC}"
1 | #!/bin/bash |
2 | |
3 | # Kolla om till exempel qimgv är installerat eller inte |
4 | |
5 | # VARIABLES |
6 | dir_home='/home/airikr' |
7 | dir_backup='backup-ssd-dir' |
8 | YELLOW='\033[1;33m' |
9 | BLUE='\033[0;34m' |
10 | NC='\033[0m' |
11 | SLEEP='.5' |
12 | |
13 | # COPY > PASTE |
14 | echo && printf "${YELLOW}Restoring bash files" && printf "${NC}" && echo && echo && sleep .5 |
15 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.bashrc "${dir_home}"/ |
16 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.bash_aliases "${dir_home}"/ |
17 | sudo rsync -aP "${dir_backup}"/"$dir_home"/systembackup.sh "$dir_home"/ |
18 | sudo rsync -aP "${dir_backup}"/"$dir_home"/transferphotos-card.sh "${dir_home}"/ |
19 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/transferphotos-ext.sh "${dir_home}"/ |
20 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/transferphotos-ext.sh "${dir_home}"/ |
21 | |
22 | echo && printf "${YELLOW}Restoring the fstab file" && printf "${NC}" && echo && echo && sleep .5 |
23 | sudo cp /etc/fstab /etc/fstab.bak |
24 | sudo rsync -aP "${dir_backup}"/etc/fstab /etc/ |
25 | |
26 | echo && printf "${YELLOW}Sourcing the bash_aliases file" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
27 | source "${dir_home}"/.bash_aliases |
28 | |
29 | # UNINSTALL |
30 | echo && printf "${YELLOW}Uninstalling bloatware" && printf "${NC}" && echo && echo && sleep .5 |
31 | which parole | grep -o parole > /dev/null && sudo pacman -Rcns parole || echo '${BLUE}parole is not installed${NC}' |
32 | which firewalld | grep -o firewalld > /dev/null && sudo pacman -Rcns firewalld || echo '${BLUE}firewalld is not installed${NC}' |
33 | which galculator | grep -o galculator > /dev/null && sudo pacman -Rcns galculator || echo '${BLUE}galculator is not installed${NC}' |
34 | which ristretto | grep -o ristretto > /dev/null && sudo pacman -Rcns ristretto || echo '${BLUE}ristretto is not installed${NC}' |
35 | which cmake | grep -o cmake > /dev/null && sudo pacman -Rcns cmake || echo '${BLUE}cmake is not installed${NC}' |
36 | which eos-quickstart | grep -o eos-quickstart > /dev/null && sudo pacman -Rcns eos-quickstart || echo '${BLUE}eos-quickstart is not installed${NC}' |
37 | 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}' |
38 | which welcome | grep -o welcome > /dev/null && sudo pacman -Rcns welcome || echo '${BLUE}welcome is not installed${NC}' |
39 | |
40 | # UPDATE |
41 | echo && printf "${YELLOW}Updating" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
42 | yay -Syu --noconfirm |
43 | |
44 | # INSTALL |
45 | echo && printf "${YELLOW}Installing softwares" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
46 | yay -S --noconfirm mullvad-vpn-bin vscodium-bin qimgv-git ttf-victor-mono smartgit blue-recorder-git josm-stable xfce4-panel-profiles xfce4-docklike-plugin |
47 | sudo 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 perl-image-exiftool npm lite-xl |
48 | wget -O - https://raw.githubusercontent.com/laurent22/joplin/dev/Joplin_install_and_update.sh | bash |
49 | |
50 | # CREATE FOLDER |
51 | echo && printf "${YELLOW}Creating missing folders" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
52 | sudo mkdir /mnt/Backup |
53 | sudo mkdir /mnt/NAS |
54 | sudo mkdir /mnt/Synology |
55 | |
56 | # INSTALL GRAPHIC DRIVERS |
57 | echo && printf "${YELLOW}Installing graphic cards stuff" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
58 | install_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 |
61 | echo && printf "${YELLOW}Configuring the graphic card" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
62 | sudo nvidia-xconfig |
63 | sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.d/20-nvidia.conf |
64 | |
65 | |
66 | |
67 | # COPY > PASTE |
68 | echo && printf "${YELLOW}Restoring backed up files" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
69 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/darktable/ "${dir_home}"/.config/darktable/ |
70 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/mpv/ "${dir_home}"/.config/mpv/ |
71 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/'Mullvad VPN'/ "${dir_home}"/.config/'Mullvad VPN'/ |
72 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/qimgv/ "${dir_home}"/.config/qimgv/ |
73 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/obs-studio/ "${dir_home}"/.config/obs-studio/ |
74 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/smartgit/ "${dir_home}"/.config/smartgit/ |
75 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/filezilla/ "${dir_home}"/.config/filezilla/ |
76 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/GIMP/ "${dir_home}"/.config/GIMP/ |
77 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/FreeFileSync/ "${dir_home}"/.config/FreeFileSync/ |
78 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/JOSM/ "${dir_home}"/.config/JOSM/ |
79 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/Joplin/ "${dir_home}"/.config/Joplin/ |
80 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/joplin-desktop/ "${dir_home}"/.config/joplin-desktop/ |
81 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/SpeedCrunch/ "${dir_home}"/.config/SpeedCrunch/ |
82 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/VSCodium/ "${dir_home}"/.config/VSCodium/ |
83 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/VirtualBox/ "${dir_home}"/.config/VirtualBox/ |
84 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/qBittorrent/ "${dir_home}"/.config/qBittorrent/ |
85 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/lite-xl/ "${dir_home}"/.config/lite-xl/ |
86 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/qmmp/ "${dir_home}"/.config/qmmp/ |
87 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.config/Mumble/ "${dir_home}"/.config/Mumble/ |
88 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.mozilla/firefox/ "${dir_home}"/.mozilla/firefox/ |
89 | |
90 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.thunderbird/ "${dir_home}"/.thunderbird/ |
91 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.joplin/ "${dir_home}"/.joplin/ |
92 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/.vscode-oss/ "${dir_home}"/.vscode-oss/ |
93 | |
94 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/Pictures/Wallpapers/ "${dir_home}"/Pictures/Wallpapers/ |
95 | sudo rsync -aP "${dir_backup}"/"${dir_home}"/Documents/ "${dir_home}"/Documents/ |
96 | |
97 | |
98 | |
99 | # JELLYFIN |
100 | echo && printf "${YELLOW}Configuring Jellyfin" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
101 | sudo rsync -aP "${dir_backup}"/var/lib/jellyfin/ /var/lib/jellyfin/ |
102 | sudo chown -R jellyfin:jellyfin /var/lib/jellyfin/ |
103 | sudo chmod -R 777 /var/lib/jellyfin/ |
104 | sudo systemctl restart jellyfin.service |
105 | |
106 | |
107 | |
108 | # APACHE |
109 | echo && printf "${YELLOW}Installing Apache" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
110 | sudo pacman -Sy apache |
111 | |
112 | # MYSQL |
113 | echo && printf "${YELLOW}Installing MariaDB" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
114 | sudo pacman -Sy mariadb |
115 | sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql |
116 | sudo systemctl start mariadb.service |
117 | sudo mysql_secure_installation |
118 | |
119 | # PHP |
120 | echo && printf "${YELLOW}Installing PHP" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
121 | sudo pacman -Sy php php-apache php-gd php-fpm php-sqlite php-pgsql |
122 | |
123 | # ENABLE BOOT |
124 | echo && printf "${YELLOW}Enabling services for boot" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
125 | sudo systemctl enable mysqld httpd sshd jellyfin syncthing@airikr.service |
126 | |
127 | # START |
128 | echo && printf "${YELLOW}Starting SSH & Syncthing" && printf "${NC}" && echo && echo |
129 | sudo systemctl start sshd syncthing@airikr.service |
130 | |
131 | # COMPOSER |
132 | echo && printf "${YELLOW}Installing Composer" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
133 | php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" |
134 | php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" |
135 | php composer-setup.php |
136 | php -r "unlink('composer-setup.php');" |
137 | sudo mv composer.phar /usr/local/bin/composer |
138 | |
139 | # GEOSPATIAL |
140 | git clone https://github.com/php-geospatial/geospatial.git |
141 | cd geospatial |
142 | phpize |
143 | ./configure --enable-geospatial |
144 | make |
145 | sudo make install |
146 | |
147 | # COPY > PASTE |
148 | echo && printf "${YELLOW}Restoring configuration files for web server" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
149 | sudo rsync -aP "${dir_backup}"/etc/httpd/conf/httpd.conf /etc/httpd/conf/ |
150 | sudo rsync -aP "${dir_backup}"/etc/httpd/conf/extra/phpmyadmin.conf /etc/httpd/conf/extra/ |
151 | sudo rsync -aP "${dir_backup}"/etc/php/php.ini /etc/php/ |
152 | |
153 | echo && printf "${YELLOW}Restoring website projects" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
154 | sudo rsync -aP "${dir_backup}"/srv/http/ /srv/http/ |
155 | |
156 | # RESTART |
157 | echo && printf "${YELLOW}Restarting Apache" && printf "${NC}" && echo && echo && sleep ${SLEEP} |
158 | sudo systemctl restart httpd.service |
159 | |
160 | # ADDING USER |
161 | sudo usermod -a -G vboxusers $USER |
162 | |
163 | # INSTRUCTIONS |
164 | printf "${BLUE}" |
165 | echo |
166 | echo '--------' |
167 | echo |
168 | echo 'Use the following if root's password is wrong' |
169 | echo 'sudo mysql' |
170 | echo 'ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('password');' |
171 | echo 'quit' |
172 | echo |
173 | echo '--------' |
174 | echo |
175 | echo 'Connect to MySQL with the root user' |
176 | echo '/usr/bin/mariadb -u root -p' |
177 | echo |
178 | echo 'To create a new user and grant all privileges' |
179 | echo 'CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';' |
180 | echo 'GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost';' |
181 | echo |
182 | echo 'To change the username' |
183 | echo 'RENAME USER 'user'@'localhost' to 'new-user'@'localhost';' |
184 | echo |
185 | echo 'To change the password' |
186 | echo 'ALTER USER 'user'@'localhost' IDENTIFIED BY 'new-password';' |
187 | echo |
188 | echo 'quit' |
189 | echo |
190 | echo '--------' |
191 | echo |
192 | echo 'sudo nano /etc/X11/xorg.conf.d/20-nvidia.conf' |
193 | echo 'Follow the instructions below NVIDIA Improvements at https://steamcommunity.com/sharedfiles/filedetails/?id=1787799592' |
194 | echo |
195 | echo 'Download FreeFileSync at https://freefilesync.org/' |
196 | echo |
197 | echo 'Log out and log back in again to enable vboxusers' |
198 | printf "${NC}" |