|
|
@ -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." |
|
|
|