1754697949

This commit is contained in:
2025-08-08 18:05:48 -06:00
parent 1356bc955f
commit 675255f72e
+17 -6
View File
@@ -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"
sudo chmod -R 775 $finalDir