Minor refactors

This commit is contained in:
oitsjustjose 2025-09-09 12:47:52 -05:00
commit bf62abff05
10 changed files with 118 additions and 84 deletions

View file

@ -17,6 +17,7 @@ fi
mkdir -p /opt/scripts
cp "../python/$script_fn" "/opt/scripts/$script_fn"
cp "../python/utils.py" "/opt/scripts/utils.py"
# Create executable as a script, install to local/bin
echo "/usr/bin/python3 /opt/scripts/$script_fn \"\$@\"" > $cmd_name

View file

@ -17,6 +17,7 @@ fi
mkdir -p /opt/scripts
cp "../python/$script_fn" "/opt/scripts/$script_fn"
cp "../python/utils.py" "/opt/scripts/utils.py"
# Create executable as a script, install to local/bin
echo "/usr/bin/python3 /opt/scripts/$script_fn \"\$@\"" > $cmd_name

View file

@ -17,6 +17,7 @@ fi
mkdir -p /opt/scripts
cp "../python/$script_fn" "/opt/scripts/$script_fn"
cp "../python/utils.py" "/opt/scripts/utils.py"
# Create executable as a script, install to local/bin
echo "/usr/bin/python3 /opt/scripts/$script_fn \"\$@\"" > $cmd_name

27
linux/setup/setup_wifiqr.sh Executable file
View file

@ -0,0 +1,27 @@
#!/bin/bash
cmd_name="wifi-qr"
script_fn="wifi_qr.py"
# Re-run the script as root if we're not
if [ "$EUID" != 0 ]; then
sudo "$0" "$@"
exit $?
fi
echo "Setting up $cmd_name"
if ! command -v /usr/bin/python3 2>&1 >/dev/null
then
echo "/usr/bin/python3 does not exist! Please install it before continuing..."
exit 1
fi
mkdir -p /opt/scripts
cp "../python/$script_fn" "/opt/scripts/$script_fn"
cp "../python/utils.py" "/opt/scripts/utils.py"
# Create executable as a script, install to local/bin
echo "/usr/bin/python3 /opt/scripts/$script_fn \"\$@\"" > $cmd_name
chmod +x $cmd_name
mv $cmd_name /usr/local/bin
echo "Done! Try the command '$cmd_name' to see the effects!"