-
Notifications
You must be signed in to change notification settings - Fork 5
/
psql-toolkit-installer.sh
53 lines (43 loc) · 1.52 KB
/
psql-toolkit-installer.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
#! /bin/sh
#
# psql-toolkit-installer.sh
# Copyright (C) 2021 Jesus R. Sanchez <jesus@neotec.do>
#
# Distributed under terms of the BSD license.
#
splash() {
echo " # # # #"
echo " # #### #### # ##### # # #"
echo " # # # # # ### # # # # # #"
echo "#### ## ### # # # # # # # # ### ### # # # # ##"
echo "# # # # ## # # # # ### # # # # # # # # # # # #"
echo "# # # # # # # # # # ##### # # # # # # ### # #"
echo "# ## # # # # # # # # # # # # # # # # # # # # #"
echo "### ## #### # #### #### ## ## ### ### ### # ## # # ##"
echo "# #"
echo "## ##"
return 0
}
install_process() {
mkdir -p ${HOME}/.config/psql
cp -frv .config/psql/* ${HOME}/.config/psql
cp -frv .psqlrc ${HOME}/
return $?
}
splash
if [ ! -d ${HOME}/.config/psql ];
then
read -n 1 -s -r -p "Press any key to continue the install process..."
install_process
RETVAL=$?
else
echo "psql DBA Toolkit already installed..."
echo "creating backup to reinstall"
mv -fv ${HOME}/.config/psql ${HOME}/.config/psql_backup
mv -fv ${HOME}/.psqlrc ${HOME}/.psqlrc_backup
read -n 1 -s -r -p "Press any key to continue the install process..."
install_process
RETVAL=$?
fi
echo "Install finished"
exit ${RETVAL}