This repository has been archived by the owner on Mar 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfedora_restore.sh
executable file
·150 lines (126 loc) · 4.37 KB
/
fedora_restore.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#!/usr/bin/bash
# A BASH script used to restore my Fedora system
## TODO
# Resolve section issues
# Resolve permission issues
## zsh
## vim
## vimwiki
## gits
## Check if running as root
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
else
echo "Script running as root!"
echo "This is good!"
fi
echo "Pre-flight all clear"
echo "Creating LAMP stack"
echo "Press Control + C to quit at any time"
## Enter username to configure
echo "Some configurations are user specific"
echo "Enter a username to configure:"
read username
## Update system and reinstall software
### Update system
echo "Updating system"
dnf update -y && dnf upgrade -y
### Install repo software
echo "Installing essential software"
dnf install liberation-fonts-1:2.1.0-1.fc32.noarch python3 qt5 zsh git autokey-gtk redshift cmake gcc-c++ make python3-devel python3-SecretStorage python3-crypto python3-cryptography python3-keyring python3-psutil python3-qt5 python3-requests-kerberos speedtest-cli neofetch gimp -y
### Install rpm software
#### Download and Install Google Chrome
cd /home/$username/Downloads
echo "Downloading and installing Google Chrome"
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
rpm -Uhv google-chrome-stable_current_x86_64.rpm
#### Download and Install Nagstamon
echo "Downloading and installing Nagstamon"
wget https://nagstamon.ifw-dresden.de/files/stable/nagstamon-3.4.1.fedora32-1.src.rpm
rpm -Uhv nagstamon-3.4.1.fedora32-1.src.rpm
echo "Nagstamon will still need configured"
### Enable SNAP classic
echo "Installing snap store"
dnf install snapd -y
ln -s /var/lib/snapd/snap /snap/
### Install SNAP store software
echo "Google Cloud SDK"
snap install google-cloud-sdk --classic
### Install non-repo and non-RPM software
#### Install MotionPro
echo "Downloading and installing MotionPro"
cd /home/$username/Downloads
wget https://www.hipaavault.com/ArrayNetworks/MotionPro_Linux_RedHat_x86-64_1.2.3.sh
chmod +x MotionPro_Linux_RedHat_x86-64_1.2.3.sh
bash MotionPro_Linux_RedHat_x86-64_1.2.3.sh
echo "MotionPro will still need configured"
## Clone config repo
### Permissions
echo "Cloning config repo"
cd /home/$username/Documents/
mkdir gits
cd gits
git clone https://gitlab.com/ngrogg/configs.git
### Copy vimrc and zshrc
echo "Copying vimrc and zshrc"
cd configs
cp Desktop\ Configs/vimrc /home/$username/.vimrc
cp Desktop\ Configs/zshrc /home/$username/.zshrc
### Configure zsh
#### Review this section
echo "Configuring zsh"
echo "Use tab for fuzzy autocomplete"
sleep 5
cd /home/$username
mkdir /home/$username/.zsh/
mkdir /home/$username/.zsh/cache
touch /home/$username/.zsh/cache/history
sed -i "s/\/home\/$username\:\/usr\/bin\/bash/\/home\/$username\:\/usr\/bin\/zsh/g" /etc/passwd
### Open vim to trigger installation of plugins
#### Review that section
cd /home/$username
echo "Quit vim after installation finishes"
sleep 5
vim .vimrc
### Install YouCompleteMe
#### Review that section
echo "Installing YouCompleteMe"
cd .vim/plugged/YouCompleteMe/
python3 install.py --clangd-completer
## Configure vim wiki and linux academy repo
### Clone vimwiki notes repo
#### Permissions
echo "Cloning notes from git repo"
cd /home/$username/Documents/gits
git clone https://github.com/ngrogg360/notes.git
#### Create vimwiki directory
cd /home/$username
mkdir vimwiki
#### Copy vimwiki
echo "Copying vimwiki"
echo "Access vimwiki by opening vi and pressing \ w w"
sleep 5
cp /home/$username/Documents/gits/notes/*.wiki ~/vimwiki
#### Copy wikito/wikifrom scripts
echo "Copying scripts from configs"
mkdir /home/$username/.scripts
if [ "$username" == "ngrogg" ]; then
cp /home/$username/Documents/gits/notes/backupwiki.sh /home/$username/.scripts/wikitogit.sh
cp /home/$username/Documents/gits/notes/restorewiki.sh /home/$username/.scripts/wikifromgit.sh
else
cp /home/$username/Documents/gits/notes/restorewiki.sh /home/$username/.scripts/wikifromgit.sh
fi
#### Add aliases to zshrc
echo "Adding aliases to zshrc"
if [ "$username" == "ngrogg" ]; then
echo "alias wikitogit='bash ~/.scripts/wikitogit.sh'" >> /home/$username/.zshrc
echo "alias wikifromgit='bash ~/.scripts/wikifromgit.sh'" >> /home/$username/.zshrc
else
echo "alias wikifromgit='bash ~/.scripts/wikifromgit.sh'" >> /home/$username/.zshrc
fi
## Reboot system
#echo "Intial configuration complete, system will reboot in 5 seconds"
echo "Initial configuration complete, reboot system to finish configuration"
sleep 5
#reboot