diff --git a/customscripts/configure_webhook.sh b/customscripts/configure_webhook.sh index 19825c0..98395ac 100644 --- a/customscripts/configure_webhook.sh +++ b/customscripts/configure_webhook.sh @@ -1,20 +1,31 @@ #!/bin/bash +finalDir='/usr/share/customscripts' + +# ta get da right usermayhaps +if [[ -z $SUDO_USER ]]; then + echo "Using User $USER" + username="$USER" +else + echo "Using User $SUDO_USER" + username="$SUDO_USER" +fi + # get webhook url echo "Enter Discord Webhook URL" -read url +read webhook_url # get tag echo "Enter Tag to Notify" -read tag +read webhook_tag # write da files -sudo bash -c "echo '$url' > /usr/share/customscripts/webhook.txt" -sudo bash -c "echo '$tag' > /usr/share/customscripts/tag.txt" +sudo bash -c "echo '$webhook_url' > $finalDir/webhook.txt" +sudo bash -c "echo '$webhook_tag' > $finalDir/tag.txt" # fix ownership echo "Changing ownership of $finalDir to $username:$username recursively" -sudo chown -R $username:$username "$finalDir" +sudo chown -R $username:$username $finalDir # fix perms echo "Setting perms of $finalDir and contents to 775" -sudo chmod -R 775 "$finalDir" \ No newline at end of file +sudo chmod -R 775 $finalDir \ No newline at end of file