Initial commit
This commit is contained in:
29
update.sh
Normal file
29
update.sh
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
base_dir=$(pwd)
|
||||
|
||||
echo "Updating service scripts..."
|
||||
podman-openrc ./services /etc/init.d/
|
||||
|
||||
# Update services (awall policies, scripts)
|
||||
for service in "./services"/*/; do
|
||||
[ -d "$service" ] || continue
|
||||
cd "$service" || continue
|
||||
|
||||
# Run update.sh if present
|
||||
if [ -f "update.sh" ]; then
|
||||
source ./update.sh
|
||||
fi
|
||||
|
||||
# Symlink and activate each *.policy.json
|
||||
for policy in *.policy.json; do
|
||||
[ -e "$policy" ] || continue
|
||||
POLICY_NAME="${policy%.policy.json}"
|
||||
ln -sf "./$policy" "/etc/awall/optional/$POLICY_NAME.policy.json"
|
||||
awall enable "$POLICY_NAME.policy"
|
||||
done
|
||||
|
||||
cd "$base_dir"
|
||||
done
|
||||
|
||||
echo "Activating firewall..."
|
||||
awall activate
|
||||
Reference in New Issue
Block a user