Skip to content
Snippets Groups Projects

Setup silecs environments

Merged m.nabywaniec requested to merge 64-silecs-env-setup into master
2 files
+ 77
42
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 0
42
@@ -59,45 +59,3 @@ for PACKAGE in $PACKAGES; do
done
exit 0
# Update Silecs environment variables to ~/.profile
PROFILE=~/.profile
if [[ -f $PROFILE ]]; then
echo "$PROFILE exists";
else
echo "Profile not exists will be created";
touch $PROFILE;
if [[ -f $PROFILE ]]; then
echo "$PROFILE exists";
else
echo "Cannot create $PROFILE, exiting...";
exit 1;
fi
fi
if grep "SILECS_VERSION=" "$PROFILE"; then
while true; do
read -p "Do you want to set new silecs environment in $PROFILE? [y/n]" yn
case $yn in
[Yy]* ) sed -i "/SILECS_VERSION/d" $PROFILE;
echo -e "SILECS_VERSION=$1" >> $PROFILE;
echo -e "export $2/\$SILECS_VERSION/silecs-cli:\$PATH" >> $PROFILE;
echo -e "export $2/\$SILECS_VERSION/silecs-cli-client/bin/x86_64:\$PATH" >> $PROFILE;
echo -e "export $2/\$SILECS_VERSION/silecs-diagnostic-cpp/bin/x86_64:\$PATH" >> $PROFILE;
echo "Silecs variables updated in $PROFILE!"
exit;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
echo "String exists"
else
sed -i "/SILECS_VERSION/d" $PROFILE;
echo -e "SILECS_VERSION=$1" >> $PROFILE;
echo -e "export $2/\$SILECS_VERSION/silecs-cli:\$PATH" >> $PROFILE;
echo -e "export $2/\$SILECS_VERSION/silecs-cli-client/bin/x86_64:\$PATH" >> $PROFILE;
echo -e "export $2/\$SILECS_VERSION/silecs-diagnostic-cpp/bin/x86_64:\$PATH" >> $PROFILE;
echo "Silecs variables added to $PROFILE!"
fi
exit 0
\ No newline at end of file
Loading