Skip to content
systemctl_commands 392 B
Newer Older
Pierre Ozoux's avatar
Pierre Ozoux committed
#!/bin/bash

Pierre Ozoux's avatar
Pierre Ozoux committed
command=`basename "$0"`
first_level_path=`pwd | cut -d'/' -f2`
second_level_path=`pwd | cut -d'/' -f3`

if [ "$first_level_path" == "system" ]; then
  module=`pwd | cut -d'/' -f3`
  systemctl $command s@$module
elif [ "$first_level_path" == "data" ]; then
  if [ "$second_level_path" == "domains" ]; then
    domain=`pwd | cut -d'/' -f4`
    systemctl $command u@$domain
  fi
fi