forked from BioLockJ-Dev-Team/BioLockJ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·27 lines (24 loc) · 1.29 KB
/
install
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
#!/bin/bash
###################################################################################
## ##
## This script update user profile to run $BLJ/script/blj_config ##
## If using bash, user_profile=~/.bash_profile (set on 11 as the default val) ##
## If using another env, like zsh, update blj_profile value on line 11 below ##
## If profile exists: save backup wtih ~ appended to name (ex. $blj_profile~ ##
## ##
###################################################################################
export BLJ="$( cd "$( dirname ${BASH_SOURCE[0]} )" && pwd )"
. $BLJ/script/blj_functions
user_profile=$(get_default_profile)
bljDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ ! -f "$user_profile" ]; then
printf '%s\n' '#BioLockJ generated bash profile' > $user_profile
echo " Created profile: $user_profile"
elif [ ! -x "$user_profile" ]; then
cp $user_profile $user_profile~
echo " Saved backup: $user_profile~"
fi
echo "[ -f $bljDir/script/blj_config ] && . $bljDir/script/blj_config" >> $user_profile
source $user_profile
echo " Saved profile: $user_profile"
echo "BioLockJ installation complete!"