Browse Source

working on install script

feature/startup-from-labels
Mar Alegre 5 years ago
parent
commit
eaf2c42446
  1. 2
      .install/bin/pdm-build
  2. 26
      install.sh

2
.install/bin/pdm-build

@ -34,7 +34,7 @@ Options:
-d Debug mode: don't delete the temporary container created by the script
when encountering an error
-t [tag] Tag the image with the given string. Can be used multiple times to assign
the image multiple tags
multiple tags
-h Display this help and exit"
# Handle options

26
install.sh

@ -1,7 +1,7 @@
#!/bin/bash
# Main
set -e
set -eEuo pipefail
trap 'echo "Error detected: aborting installation."' ERR
echo "Attempting to autodetect distro ..."
distro=$(lsb_release -is)
@ -31,18 +31,26 @@ fi
echo "Copying scripts to /usr/local/bin ..."
# copy bin files to /usr/local/bin
sudo cp install/bin/* /usr/local/bin/
# copy shflags to /usr/local/bin as well
sudo cp install/shflags /usr/local/bin/
sudo cp .install/bin/* /usr/local/bin/
echo "Installing containers startup service ..."
# install systemd startup service
sudo cp install/containers-startup.service /etc/systemd/system/
sudo cp .install/containers-startup.service /etc/systemd/system/
sudo systemctl enable containers-startup.service
# create startup.sh if it doesn't exist
if [[ ! -f /etc/containers/startup.sh ]]; then
printf "#!/bin/bash\n\n" | sudo tee /etc/containers/startup.sh
printf "#!/bin/bash\n\n" | sudo tee /etc/containers/startup.sh > /dev/null
echo "Installed containers startup script in /etc/containers/startup.sh"
echo "Put any podman-related commands that should run on startup in that file."
else
echo "Not overwriting /etc/containers/startup.sh as it already exists."
fi
sudo chmod +x /etc/containers/startup.sh
echo "Installed containers startup script in /etc/containers/startup.sh."
echo "Put any podman-related commands that should run on startup in that file."
if id -u containers; then
echo "Configuring user 'containers' ..."
echo 'Creating "containers" user ...'
echo "Install finished successfully."

Loading…
Cancel
Save