forked from zerobyte-id-bak/Bashter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.bash
51 lines (41 loc) · 1.42 KB
/
setup.bash
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/bash
echo -ne "[?] Configure BASHTER_HOME : ${HOME}/"
read BASHTER_HOME
BASHTER_HOME="${HOME}/${BASHTER_HOME}"
if [[ -d ${BASHTER_HOME} ]]
then
echo "WARN: \"${BASHTER_HOME}\" already exists, please remove it before install!"
exit
fi
mkdir ${BASHTER_HOME}
if [[ ! -d ${BASHTER_HOME} ]]
then
echo "ERROR: Cannot create directory ${BASHTER_HOME}"
fi
echo "#########################" > ${BASHTER_HOME}/CONFIG.bash
echo "# BASHTER CONFIGURATION #" >> ${BASHTER_HOME}/CONFIG.bash
echo "#########################" >> ${BASHTER_HOME}/CONFIG.bash
echo "BASHTER_HOME=\"${BASHTER_HOME}\"" >> ${BASHTER_HOME}/CONFIG.bash
echo "TMPFILE=\"\${BASHTER_HOME}/.temp\"" >> ${BASHTER_HOME}/CONFIG.bash
echo "BANNERFILE=\"\${BASHTER_HOME}/BANNER.file\"" >> ${BASHTER_HOME}/CONFIG.bash
echo "PARTSPATH=\"\${BASHTER_HOME}/parts\"" >> ${BASHTER_HOME}/CONFIG.bash
echo "BASHTER_VERSION=\"3.0\"" >> ${BASHTER_HOME}/CONFIG.bash
echo "RELEASED_DATE=\"21 April 2019\"" >> ${BASHTER_HOME}/CONFIG.bash
cp -rf $(pwd)/* ${BASHTER_HOME}/
rm ${BASHTER_HOME}/setup.bash
sed -i "s|/path-to/|${BASHTER_HOME}/|g" ${BASHTER_HOME}/bashter.bash
for BASH_FILE in $(find ${BASHTER_HOME}/ | grep bash$)
do
chmod +x ${BASH_FILE}
done
cat << EOF
[+] INSTALL DONE! [+]
Run script:
# bash ${BASHTER_HOME}/bashter.bash
OR
# ${BASHTER_HOME}/bashter.bash
OR YOU CAN CREATE A SYMLINK LIKE THIS! (run as root)
# ln -sf ${BASHTER_HOME}/bashter.bash /usr/bin/bashter
And then
# bashter
EOF