1754697949
This commit is contained in:
@@ -1,20 +1,31 @@
|
|||||||
#!/bin/bash
|
#!/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
|
# get webhook url
|
||||||
echo "Enter Discord Webhook URL"
|
echo "Enter Discord Webhook URL"
|
||||||
read url
|
read webhook_url
|
||||||
|
|
||||||
# get tag
|
# get tag
|
||||||
echo "Enter Tag to Notify"
|
echo "Enter Tag to Notify"
|
||||||
read tag
|
read webhook_tag
|
||||||
|
|
||||||
# write da files
|
# write da files
|
||||||
sudo bash -c "echo '$url' > /usr/share/customscripts/webhook.txt"
|
sudo bash -c "echo '$webhook_url' > $finalDir/webhook.txt"
|
||||||
sudo bash -c "echo '$tag' > /usr/share/customscripts/tag.txt"
|
sudo bash -c "echo '$webhook_tag' > $finalDir/tag.txt"
|
||||||
|
|
||||||
# fix ownership
|
# fix ownership
|
||||||
echo "Changing ownership of $finalDir to $username:$username recursively"
|
echo "Changing ownership of $finalDir to $username:$username recursively"
|
||||||
sudo chown -R $username:$username "$finalDir"
|
sudo chown -R $username:$username $finalDir
|
||||||
|
|
||||||
# fix perms
|
# fix perms
|
||||||
echo "Setting perms of $finalDir and contents to 775"
|
echo "Setting perms of $finalDir and contents to 775"
|
||||||
sudo chmod -R 775 "$finalDir"
|
sudo chmod -R 775 $finalDir
|
||||||
Reference in New Issue
Block a user