Skip to content
Snippets Groups Projects
Unverified Commit 6f13ea79 authored by Volkor The Barbarian Warrior's avatar Volkor The Barbarian Warrior
Browse files

add license, fix gitlab ci, new installation method

parent 97e90ca3
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,9 @@ test:
image: alpine:latest
tags:
- docker
cache:
paths:
- binaries/*.apk
script:
- apk update && apk add curl libnotify bash jq
- bash
......
LICENSE 0 → 100644
MIT License
Copyright (c) 2018 Volkor The Barbarian Warrior
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
install:
type curl && type jq || exit 1
mkdir -p $(DESTDIR)/usr/bin
install -m 0755 supload.sh $(DESTDIR)/usr/local/bin/supload
install -m 0755 supload.conf $(DESTDIR)/etc/supload.conf
uninstall:
rm $(DESTDIR)/usr/bin/supload
\ No newline at end of file
......@@ -9,19 +9,8 @@ To install this, you can follow the commands below:
```bash
git clone https://gitlab.com/Volkor/supload.git
cd curl-uploader
chmod +x install.sh
./install.sh
```
If you install supload to anything but the default (conflicting filenames), mentally replace `supload` with whatever you named it if you spot it in the documentation
if the install.sh fails (report the actual issue), and copy the files manually as a workaround with:
```bash
sudo cp upload.sh /usr/bin/upload
sudo cp screenshot.sh /usr/bin/screenshot
sudo chmod +x /usr/bin/screenshot /usr/bin/upload
cd SUpload
sudo make install
```
## Dependencies
......
#!/bin/bash
r=$(tput smso)
b=$(tput bold)
n=$(tput sgr0)
red=$(tput setaf 1)
check_dep() {
type $@ >/dev/null 2>&1 || { echo >&2 "I require "$@" but it's not installed. Aborting."; exit 1; }
}
check_opt() {
type $@ >/dev/null 2>&1 || { echo >&2 "I recommend you install "$@" for full functionality"; }
}
install() {
if sudo ln -s $PWD/supload.sh /usr/bin/supload ; then
echo "Installation Successful, You can now use the command 'supload'!'"
exit 0
else
while true; do # Fixing menu
options=("${r}D${n}elete the current file at /usr/bin/supload and reinstall (Not recommended)" \
"${r}U${n}se an alternative name for SUpload (Recommended)" \
"${r}E${n}xit and give up like a little baby.")
PS3="${red}Failed to create symbolic link.${n} Enter an option [1,2,3/D,U,E]"
select opt in "${options[@]}"
do
case $REPLY in
1 | [Dd]*) sudo rm /usr/bin/supload; install ;;
2 | [Uu]*) read -p "What name would you want to use (cumload, upload, cumzone, supload)" newname; sudo ln -s $PWD/supload.sh /usr/bin/$newname; echo "Installation Successful, You can now use the command '"$newname"'!"; exit ;;
3 | [Ee]*) echo "you baby"; exit ;;
*) echo "Invalid Option!" ;;
esac
done
done
fi
}
clear
check_dep curl
check_dep jq
check_opt scrot
check_opt xclip
check_opt notify-send
install
\ No newline at end of file
......@@ -68,8 +68,7 @@ upload_file() {
response=$(curl $CURL_OPTIONS -F file=@"$1" "$BASE_URL") || { echo -e >&2 "${R}ERROR:${NC} Curl upload failure. (Invalid file, or bad internet connection)"; exit 1; }
$DEBUG && echo -e "${R}DEBUG:${NC} RESPONSE: $response"
file=$(echo $response | jq -r '.["file"]')
url="$BASE_URL$file"
url=$(echo $response | jq -r '.["url"]')
deletionlink=$(echo $response | jq -r '.["deletionurl"]')
$DEBUG && echo -e "${R}DEBUG:${NC} URL: $url"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment