Upload files to "/"
This commit is contained in:
30
paste-installer.sh
Normal file
30
paste-installer.sh
Normal file
@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Define variables
|
||||
SCRIPT_URL="https://git.fascinated.cc/Fascinated/linux-scripts/raw/branch/master/paste.sh"
|
||||
SCRIPT_NAME="paste.sh"
|
||||
PROFILE_FILE="$HOME/.bashrc" # Use .bash_profile for MacOS or if preferred
|
||||
|
||||
# Download the script
|
||||
echo "Downloading $SCRIPT_NAME from $SCRIPT_URL..."
|
||||
curl -o $SCRIPT_NAME $SCRIPT_URL
|
||||
|
||||
# Make the script executable
|
||||
echo "Making $SCRIPT_NAME executable..."
|
||||
chmod +x $SCRIPT_NAME
|
||||
|
||||
# Move script to the home directory
|
||||
mv $SCRIPT_NAME $HOME
|
||||
|
||||
# Insert alias into profile file if not already present
|
||||
ALIAS_COMMAND="alias paste=\"$HOME/$SCRIPT_NAME\""
|
||||
if ! grep -q "$ALIAS_COMMAND" "$PROFILE_FILE"; then
|
||||
echo "Adding alias to $PROFILE_FILE..."
|
||||
echo "$ALIAS_COMMAND" >> "$PROFILE_FILE"
|
||||
echo "Alias added. Please restart your terminal or run 'source $PROFILE_FILE' to apply changes."
|
||||
else
|
||||
echo "Alias already present in $PROFILE_FILE."
|
||||
fi
|
||||
|
||||
# Inform the user that the setup is complete
|
||||
echo "Setup complete. You can now use the 'paste' command."
|
Reference in New Issue
Block a user