Skip to content

Commit

Permalink
Fix script errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SMarioMan authored Oct 30, 2024
1 parent 6700183 commit c03500c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ config_react(){
# ----------------------------

DOWNLOAD_DOMAIN=$(echo $API_HOMEPAGE|awk -F'://' '{print $2}')
sed -z -E -i "s/(dexare:.*token:\s*)('')(.*applicationID:\s*)('')(.*downloadDomain:\s*)('localhost:5029')/\
\1'$DISCORD_BOT_TOKEN'\3'$DISCORD_APP_ID'\5'$DOWNLOAD_DOMAIN'/"\
sed -z -E -i'' "s/(dexare:.*token:\s*)('')(.*applicationID:\s*)('')(.*downloadDomain:\s*)('localhost:5029')/\
\1'${DISCORD_BOT_TOKEN}'\3'${DISCORD_APP_ID}'\5'${DOWNLOAD_DOMAIN//\//\\/}'/" \
"$craig_dir/apps/bot/config/default.js"


Expand Down Expand Up @@ -414,10 +414,10 @@ config_cook(){
esac
done
# if root, install sudo
if [ "$USER" != "root" ]
if [ "$(whoami)" == "root" ]; then
apt-get install -y sudo
then
error "Make sure sudo is installed and run again."
else
error "Make sure sudo is installed and run again."
fi

# Prompt for sudo up front for installing
Expand Down
10 changes: 5 additions & 5 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ clean_running_container() {
rm -rf "$pii_file"
done
#If no install.config mounted then try to create one from container ENVs
if ![ -f "$craig_dir/install.config" ]; then
if ! [ -f "$craig_dir/install.config" ]; then

#Assign default values if variables not set. This is dirty but using default values for variables should be implemented somewhere else.
for key in "${!defaults[@]}"; do
if ![ -v $key ]; then
export $key=${defaults[$key]};
if ! [ -v "$key" ]; then
export "$key"="${defaults[$key]}"
fi
done

Expand Down Expand Up @@ -386,8 +386,8 @@ config_react(){
# applicationID: '',
# ----------------------------
DOWNLOAD_DOMAIN=$(echo $API_HOMEPAGE|awk -F'://' '{print $2}')
sed -z -E -i "s/(dexare:.*token:\s*)('')(.*applicationID:\s*)('')(.*downloadDomain:\s*)('localhost:5029')/\
\1'$DISCORD_BOT_TOKEN'\3'$DISCORD_APP_ID'\5'$DOWNLOAD_DOMAIN'/"\
sed -z -E -i'' "s/(dexare:.*token:\s*)('')(.*applicationID:\s*)('')(.*downloadDomain:\s*)('localhost:5029')/\
\1'${DISCORD_BOT_TOKEN}'\3'${DISCORD_APP_ID}'\5'${DOWNLOAD_DOMAIN//\//\\/}'/" \
"$craig_dir/apps/bot/config/default.js"


Expand Down

0 comments on commit c03500c

Please sign in to comment.