Install dependencies and configure doas

This commit is contained in:
Harshad Sharma 2024-05-23 13:48:26 +05:30
parent 8c27138240
commit 89aefee296

View file

@ -44,3 +44,29 @@ fi
# Migrate database
echo "[migrate] Database"
<%= @app_dir %>/bin/<%= @name %> eval "Freedive.Release.migrate"
# Install inotify-tools
if pkg info inotify-tools > /dev/null 2>&1 ; then
echo "[ok] inotify-tools is installed"
else
echo "[install] inotify-tools"
pkg install -U -y inotify-tools
fi
# Install doas
if pkg info doas > /dev/null 2>&1 ; then
echo "[ok] doas is installed"
else
echo "[install] doas"
pkg install -U -y doas
fi
# Configure doas
touch /usr/local/etc/doas.conf
if ! grep -q "permit nopass <%= @user %> as root" /usr/local/etc/doas.conf ; then
echo "[configure] doas"
echo "permit nopass <%= @user %> as root" >> /usr/local/etc/doas.conf
else
echo "[ok] doas is configured"
fi