-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·34 lines (26 loc) · 1007 Bytes
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
# Installs wifichannel command line tool
# Author: Jiri Brejcha, jirka@jiribrejcha.net, @jiribrejcha
# Any feedback or improvements are very welcome
# Check if the script is running as root
if [[ $EUID -ne 0 ]]; then
echo "This script must run as root. Add \"sudo\" please".
exit 1
fi
# Installation directory
DIR="/usr/local/bin"
if [ ! -d "$DIR" ]; then
echo "Directory $DIR does not exist. Creating it..."
sudo mkdir -p "$DIR"
if [ $? -eq 0 ]; then
echo "Directory $DIR created successfully."
else
echo "Failed to create directory $DIR. Check your permissions."
exit 1
fi
fi
echo "Downloading wifichannel..."
curl -s https://raw.githubusercontent.com/jiribrejcha/wifichannel/main/wifichannel.sh --output /usr/local/bin/wifichannel
echo "Setting executable permissions..."
chmod +x /usr/local/bin/wifichannel
echo "All done. Start wifichannel by \"wifichannel\". On macOS, quit Terminal and restart it to enable autocompletion for wifichannel command."