File: cli

package info (click to toggle)
ufw 0.36.2-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,824 kB
  • sloc: python: 8,731; sh: 5,950; makefile: 200
file content (28 lines) | stat: -rwxr-xr-x 664 bytes parent folder | download | duplicates (4)
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
#!/bin/sh
set -e

if [ -z "$SNAP" ]; then
    echo "SNAP not set"
    exit 1
fi

if ! iptables --version >/dev/null 2>&1 ; then
    echo "Could not use iptables. Please run:"
    echo "'sudo snap connect ufw:firewall-control ubuntu-core:firewall-control'"
    exit 1
fi

PPATH=
if [ -z "$PYTHONPATH" ]; then
    PPATH=$SNAP/usr/lib/python3/dist-packages
else
    PPATH=$SNAP/usr/lib/python3/dist-packages:$PYTHONPATH
fi

PYCACHE=$SNAP_DATA/usr/lib/python3/dist-packages/ufw/__pycache__
if [ ! -d "$PYCACHE" ] ; then
    mkdir -p "$PYCACHE" 2>/dev/null || true
fi

#echo $PPATH
PYTHONPATH="$PPATH" "$SNAP"/usr/sbin/ufw --rootdir="$SNAP" --datadir="$SNAP_DATA" "$@"