Initial commit with handy scripts
This commit is contained in:
commit
074a8c3187
5 changed files with 129 additions and 0 deletions
26
linux/setup/setup_jarscan.sh
Executable file
26
linux/setup/setup_jarscan.sh
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
cmd_name="jarscan"
|
||||
script_fn="scan_jars.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"
|
||||
|
||||
# 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!"
|
||||
26
linux/setup/setup_makerand.sh
Executable file
26
linux/setup/setup_makerand.sh
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
cmd_name="makerand"
|
||||
script_fn="make_random.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"
|
||||
|
||||
# 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!"
|
||||
Loading…
Reference in a new issue