kanbanworkflowstimelinescrumrubyroadmapproject-planningproject-managementopenprojectangularissue-trackerifcgantt-chartganttbug-trackerboardsbcf
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
1.2 KiB
80 lines
1.2 KiB
4 years ago
|
#!/bin/bash
|
||
|
|
||
|
set -e
|
||
|
|
||
|
. "${INSTALLER_DIR}/wizard"
|
||
|
|
||
|
supported_distribution() {
|
||
|
case "$(wiz_fact "osfamily")" in
|
||
|
"debian")
|
||
|
case $(wiz_fact "osversion") in
|
||
|
"20.04")
|
||
|
return 0
|
||
|
;;
|
||
|
"18.04")
|
||
|
return 0
|
||
|
;;
|
||
|
"10")
|
||
|
return 0
|
||
|
;;
|
||
|
esac
|
||
|
;;
|
||
|
"redhat")
|
||
|
case "$(wiz_fact "osversion")" in
|
||
|
8*)
|
||
|
return 0
|
||
|
;;
|
||
|
esac
|
||
|
;;
|
||
|
esac
|
||
|
return 1
|
||
|
}
|
||
|
|
||
|
existing_installation() {
|
||
|
[ "$(wiz_get "server/autoinstall")" != "" ];
|
||
|
}
|
||
|
|
||
|
never_answered_before() {
|
||
|
[ "$(wiz_get "openproject/edition")" == "" ];
|
||
|
}
|
||
|
|
||
|
input_start() {
|
||
|
# on first run of the wizard, set default edition if existing OpenProject installation
|
||
|
if never_answered_before && existing_installation ; then
|
||
|
wiz_set "openproject/edition" "default"
|
||
|
STATE="done"
|
||
|
elif supported_distribution ; then
|
||
|
wiz_put "openproject/edition"
|
||
|
if wiz_ask ; then
|
||
|
STATE="done"
|
||
|
else
|
||
|
STATE="cancel"
|
||
|
fi
|
||
|
else
|
||
|
wiz_set "openproject/edition" "default"
|
||
|
STATE="done"
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
state_machine() {
|
||
|
case "$1" in
|
||
|
"start")
|
||
|
input_start
|
||
|
;;
|
||
|
"done")
|
||
|
echo "DONE"
|
||
|
exit 0
|
||
|
;;
|
||
|
"cancel")
|
||
|
echo "CANCEL"
|
||
|
exit 1
|
||
|
;;
|
||
|
*)
|
||
|
echo "invalid state ${STATE}"
|
||
|
exit 1
|
||
|
;;
|
||
|
esac
|
||
|
}
|
||
|
|
||
|
wizard "start"
|