-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·52 lines (46 loc) · 1.24 KB
/
install.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
#!/bin/bash
#assuming most users are linux
BASHFILE=~/.bashrc
# linux or mac
echo "Linux (0) or mac (1) user:"
read osvalue
case $osvalue in
0)
#no change
;;
1)
#change to .bash_profile for mac users
BASHFILE=~/.bash_profile
;;
*)
#bad input
echo "bad input ->" $osvalue
exit
;;
esac
#adding new line for prettyness
echo ' ' >> $BASHFILE
#sourcing file for command use
echo "source ~/Documents/TextSSH/.TextEditOpen.sh" >> $BASHFILE
echo "Input the user and host for the desired ssh client (e.g. user@hostname or [email protected])"
read host_val
echo export TEXTSSH_HOSTNAME=$host_val >> $BASHFILE
echo "Input path to desired text editting application (e.g. /path/to/app)"
read path_val
echo export TEXTSSH_APP_PATH=$path_val >> $BASHFILE
chmod u+x .TextEditOpen.sh
echo "if any mistakes were made providing either the application path or host name changes can be made to the $BASHFILE"
echo "making directory for use"
mkdir /etc/TextSSH.d
chown "$SUDO_USER" /etc/TextSSH.d
mkdir /etc/TextSSH
#mv ./.TextEditOpen.sh
#mv ./* /etc/TextSSH
if [ 1 == 1 ] #temp values
then
source $BASHFILE
echo "!!SUCCESS!!"
echo "!Please restart terminal to take effect!"
else
echo "try running file as sudo"
fi