-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.sh
More file actions
139 lines (95 loc) · 2.8 KB
/
debug.sh
File metadata and controls
139 lines (95 loc) · 2.8 KB
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
#!/bin/bash
##############################################
# This script is for the old laptop/computer #
##############################################
# Check for Root
user=$(whoami)
if [[ "$user" != "root" ]];
then
echo "Error: Must be run as root or run with SUDO"
exit
fi
# Check for Arch
if (! uname -r | grep -q 'arch')
then
exit
fi
# Change ulimit for session
ulimit -n 524000
# Create Packages File
pacman -Qqe > /tmp/packages.txt
function confirm() {
if (whiptail --title "$1" --yesno "$2" 8 78); then
$3
else
$4
fi
}
# Enter username
pickCurrentUser() {
clear
read -p "Enter username of both machines: " currentUser
confirm "Username" "Is $currentUser correct?" newIPAddress pickCurrentUser
}
# Get current IP address
newIPAddress(){
clear
read -p "Your New Machines IPV4? : " ipAddress
confirm "IP Address" "Is $ipAddress correct?" start newIPAddress
}
start(){
confirm "Starting Default Copy" "Confirm to copy $currentUser profile to $ipAddress" default exit
clear
}
##############################################
# Copying! #
##############################################
# SCP ZSH, BASHRC, VIMRC to Default user
home(){
scp "/home/$currentUser/.zshrc" "/home/$currentUser/.bashrc" "/home/$currentUser/.vimrc" $currentUser@$ipAddress:"/home/$currentUser/Desktop/Testing/RCs/"
}
# SCP ZSH theme
zshTheme(){
scp "/home/$currentUser/.oh-my-zsh/themes/fino.zsh-theme" $currentUser@$ipAddress:"/home/$currentUser/Desktop/Testing/ZSHTheme/"
}
# SCP Remmina
remmina(){
scp -r /home/$currentUser/.local/share/remmina/* $currentUser@$ipAddress:"/home/$currentUser/Desktop/Testing/Remmina/"
}
# SCP .config
# TODO:
# Create Pacman Packages List and SCP
pacman(){
scp '/tmp/packages.txt' $currentUser@$ipAddress:"/home/$currentUser/Desktop/Testing/Pacman/"
}
##############################################
# Copying!(ROOT) #
##############################################
# SCP Mint Icons
icons(){
scp -r "/usr/share/icons/" root@$ipAddress:"/usr/share/icons/"
}
# SCP Mint themes
themes(){
scp -r "/usr/share/themes/" root@$ipAddress:"/usr/share/themes/"
}
# SCP lightdm config
lightdm(){
scp "/etc/lightdm/lightdm.conf" $root@$ipAddress:"/etc/lightdm/"
}
# SCP Root ZSH Config
zshThemeRoot(){
scp "/root/.oh-my-zsh/themes/custom.zsh-theme" $root@$ipAddress:"/root/.oh-my-zsh/themes/"
}
default(){
clear
home
clear && echo "ZSHRC, VIMRC, BASHRC transferred" && sleep 0.5
zshTheme
clear && echo "Oh My Zsh theme transferred" && sleep 0.5
remmina
clear && echo "Remmina profiles transferred" && sleep 0.5
pacman
clear && echo "Packages list created & transferred" && sleep 0.5
}
pickCurrentUser